Git-parity: -N commit-count shorthand + single-<ref> range semantics (format-patch, log, rev-list)
Git-parity: -N commit-count shorthand + single-<ref> range semantics (format-patch, log, rev-list)
Summary
Two git muscle-memory gaps surfaced while using muse format-patch. Agents and devs coming
from git reach for these idioms reflexively; muse should accept them (or diverge only with a
loud, documented reason). Both are low-severity (workable) but high collision-likelihood.
1. -N commit-count shorthand is not accepted
git format-patch -1 / -N exports the last N commits from HEAD. muse format-patch -1 fails:
❌ '-1' is not a known branch or commit ID.
The -N shorthand is a pervasive git idiom (git log -3, git format-patch -1, …). muse log
supports -n/--max-count N but not the bare -N form. Agents will reach for -N first.
2. Single-<ref> range semantics diverge from git (silent footgun)
git format-patch <ref> exports <ref>..HEAD — commits since <ref> (exclusive). muse format-patch <ref> instead exports the single commit AT <ref> (its parent → ref). A git
user who passes the base ref expecting "everything since the base" silently gets the wrong
patch, with no error:
# branch tip = a6ca2233, its parent = e452ad9a
muse format-patch e452ad9a # exported e452ad9a ITSELF (wrong) — expected a6ca2233
muse format-patch a6ca2233 # had to pass the commit itself to export it
This bit a real workflow during the rc13 ship-out (exporting a6ca2233 to park it as a mist):
the first attempt passed the parent and produced the wrong .mpatch, caught only by inspecting
to_commit_id.
Proposed
- Accept
-N(last N commits) onformat-patch, and auditlog/rev-listfor the same bare--Ngit shorthand. - Either align
format-patch <ref>to git's<ref>..HEADsemantics, or keep single-commit semantics but require an explicitA..Brange for "since" and document the divergence prominently in--helpand the gitism glossary. - Sweep other ref/range-taking commands (
log,rev-list,diff,range-diff) for the same two gaps and capture them here or in linked tickets.
Context
Surfaced during the rc13 ship-out. Worked around at the time; filed so the git-parity gaps are captured where agents will reach for them.