Skip to content
zit Artifact [de7f88db3c]
Login

Artifact [de7f88db3c]

Artifact de7f88db3c27cbb7bf220a34d3a42bd258a239186ffff12a7683504492c3fe03:

Instance of technote [73166b0eb3] - Two names that could not be spelled by dmestas on 2026-09-20 13:57:09.
C Two\snames\sthat\scould\snot\sbe\sspelled
D 2026-09-20T13:57:09.262
E 2026-09-20T13:57:09.262 73166b0eb3f0291faf7369acd8d35ede99c499c3
N text/x-markdown
U dmestas
W 2582
# Two names that could not be spelled

Both fixes in 0.3.25 are about a name the tool stored correctly and could
not hand back.

A file called `-x.txt` was unreachable by any spelling. Passed bare it
parses as an option, which is ordinary and expected; what was missing was
the escape every other command-line tool has. `--` was itself rejected as
an unknown option. The usual fallback does not apply here either, because a
path is compared literally against the check-in's file list, so `./-x.txt`
parses cleanly and then resolves to nothing. Two spellings, neither
reaching the file. A forge serving such a repository answered 500 on every
content route for it, because the `zit cat` underneath could not be
written.

The surprise on opening the parser was that twenty of the forty-five
argument parsers already honoured the marker, including the shared flag
scanner behind `add`, `rm`, `commit` and `mv`. The convention had been
implemented wherever a parser happened to be written against the shared
scanner or as a small state machine, and skipped wherever the parser was a
hand-rolled loop. Twenty-five of those, `cat` among them.

The fix gates each option branch behind the marker rather than teaching
each parser a second copy of its own operand handling. Once the option
branches stop matching, the token falls through to the positional branches
that were already there, so `-n` after `--` becomes a name rather than a
limit flag and no parser grew a duplicate tail. Three tests pinned the old
behaviour and now pin the new one, which is what that kind of change should
look like.

The documentation went somewhere the first attempt did not. Adding the
marker to the shared help blob put it in the options table of thirty-nine
verbs, and two rules objected at once: a test requiring every options-table
flag to appear in its verb's usage line, and end-to-end tests pinning
several verbs' help verbatim. Both were saying the same thing. `--` is not
a verb's option, it is the rule every verb parses by, so it became its own
topic, `zit help options`.

The second fix is smaller and the same shape. `zit zip` wrote member names
as UTF-8 and never set the general-purpose bit that says so, and a
conforming reader must then read them as CP437: a committed `café.txt`
extracted as `café.txt`. The bytes were right the whole time; only the
label was missing. Both the local header and the central directory now take
the flag from one constant, because a reader trusts the central record for
metadata and fixing the local one alone would have changed nothing a user
sees.

Z 9ef0e99bb264026facb6e77ab6978c1d