Future work, and the decisions that closed the door on work not being done.
Behaviour that ships is documented in docs/; how the code works is
the code. What lives here is only what neither of those can hold: a measurement
that already settled a question. It also holds a design that is accepted but
not built.
Limitations that ship — unsupported languages, excluded cross-build targets,
constructs no anchor reaches — are in
docs/LIMITATIONS.md, not here.
Decided: no show --json until a named consumer needs the extent
as JSON; --porcelain stays the only machine form. Reopen with that consumer.
show --porcelain length-frames extents (FILE:ANCHOR<TAB>NBYTES plus
exactly NBYTES bytes, internal/app/show.go:33–36) because a symbol
body can contain any byte, including a header-shaped line. --json as
used on log/symbols is UTF-8 text fields. Putting the extent in a
JSON string would require an encoding choice (UTF-8 with replacement,
base64, or \u escapes) that --porcelain does not need.
Do not add --json until that encoding is decided in docs/CODES.md
and a consumer exists. --porcelain / --with-header stay the
machine-readable path. Default one-anchor output stays raw bytes.
Rejected: JSON that assumes the extent is valid UTF-8. Rejected: wrapping only the header and leaving the body on stdout after the object.
internal/app/show.go:21help,:33--porcelain,:111framed.docs/CODES.mdrgit show --porcelain— length-framed dialect, not TSV+newline.docs/CODES.md:137—--jsonis defined as one object for languages/doctor/context/symbols/log, none of which carry arbitrary file bytes.
- A Go
json.Encoderwill\uescape<ifSetEscapeHTMLstays default-true. Even with it off, invalid UTF-8 becomes U+FFFD. Base64 avoids that and is a new dialect, not "the porcelain fields." - Single-anchor default is unframed bytes for piping. JSON would
always frame, like
--porcelain, and must not change the no-flag path.
No --json on show until CODES.md names the byte encoding and a
test pins that a fixture with non-UTF-8 bytes round-trips. --porcelain
remains the scripting form.
docs/CODES.md:144 states context has no --porcelain; --json
encodes the same record stream. The default output is already TSV with a
leading type tag (internal/app/context.go:42). --porcelain as an
unknown flag is exit 129 (context.go:125–130,
internal/app/context_test.go --json --porcelain). Adding
--porcelain as a no-op alias of the default, or as a second encoding
beside --json, either changes that 129 or invents a dialect the
default already is.
Leave the refusal. If a caller wants TSV, they omit --json. If a
caller wants an explicit flag name, that is a contract change to document
in CODES.md (the three --porcelain dialects table) and in completion
(rgitContextFlags), not a silent alias.
docs/CODES.md:144— "contexthas no--porcelain".internal/app/context.go:27help ([--json]only),:125any other argument is extra.internal/app/context_test.gothe--json --porcelain129 case.internal/app/completion.gorgitContextFlags = "--json -h --help".
- Making
--porcelainsucceed as a synonym of the default changes exit 129 tests and the "records are fixed; any other argument is refused" rule indocs/USAGE.md§ Context. - Do not emit a headerless copy that drops the type tags.
Frows would then collide withrgit diff --porcelain, which is a different dialect on purpose.
rgit context --porcelain remains exit 129. --json and the text
stream stay as documented. No new flag.