grit://cooking/dogfood← what’s cooking
Tuesday, November 3, 2026 · Ubuntu (Linux 6.12.94+)

Dogfood: Branching and history editing

4 repos · 27 commands · 4 broken · 6 slow · 5 filed

Exercised merge (ff, --no-ff, --squash, --no-commit, conflicts, --check/--dry-run, unrelated histories), rebase (--onto, conflicts, continue/skip/abort, -X, --exec), pick, revert, reset (soft/mixed/hard/keep), tags and the history subcommands on scratch repos, rust-lang/cargo and git/git, comparing results against git 2.43 (trees/fsck identical in every comparable case). Correctness is generally good and git/grit interop of conflict states mostly works, but main (v0.5.29) does not compile, `pick`/`revert --abort` on a git-started cherry-pick leaves a conflicted index, pick/revert/rebase refuse detached HEAD, and pick ranges and far-base rebases are several times slower than git.

os
Ubuntu (Linux 6.12.94+) · x86_64
machine
Cursor cloud VM, 4 vCPU Intel Xeon, 16 GB RAM
versions
grit 0.5.28 (installer; main says 0.5.29) · main 8cb4162a · 2.43.0
repositories4
repofilescommits.gitnotes
octocat/Hello-World131 MBcloned, only used to confirm clone/basic ops
rust-lang/cargo3,07823,61581 MB
git/git4,86382,668326 MBplus synthetic 300-commit branches lin/lin2 (new files per commit) from v2.40.0
scratch s1..s12 + repro1/210101 MBtiny repos under /tmp/dogfood for workflow/interop testing
commandsgrit vs. system git, wall time
commandrepogritgitgrit/gitresultnotes
grit reset --hard <P1> (git master -> merge parent)git/git50 ms60 ms0.8×ok
grit merge <P2> (true merge, 1149-commit side, clean)git/git180 ms210 ms0.9×oktree identical to upstream merge commit
grit merge v2.45.4 into v2.46.0 (15 unmerged entries)git/git100 ms210 ms0.5×oksame index; one hunk's blank-line placement differs from git
grit merge --abortgit/git30 ms90 ms0.3×ok
grit merge --check v2.45.4git/git70 ms——ok
grit rebase --onto v2.46.0 v2.40.0 (300 commits, conflicting appends)git/git7.01 s2.79 s2.5×slowhyperfine; 2.5x; same tree. Related to #2531
grit rebase --onto v2.46.0 lin2~300 (300 independent commits)git/git1.86 s2.69 s0.7×okfaster than git, but memory 2.6x
grit rebase --onto v2.46.0 lin2~1 (1 commit)git/git1.71 s490 ms3.5×slow#2531
grit rebase --onto master~50 master~600 (1129 commits incl. merges)git/git3.49 s520 ms6.7×wrongnot comparable: grit replays merge commits (stops on a conflict at commit 277), git linearizes and stops at first pick; design difference
grit pick v2.40.0..lin2 (300 commits)git/git11.13 s1.59 s7.0×slow#2532, 7x
grit pick lin2~100..lin2git/git4.02 s490 ms8.2×slow#2532, 8x
grit revert v2.46.0..HEAD (300 commits)git/git1.72 s1.36 s1.3×ok
grit tag (1012 tags)git/git0.0 ms0.0 ms—ok
grit tag --contains v2.30.0git/git50 ms20 ms2.5×ok
grit describegit/git120 ms10 ms12×ok120 ms vs 10 ms, 110 ms slower than git on a 82k-commit repo (marginal; not filed). Distance differs from git's (425 vs 431) because git's describe depth is approximate; grit matches rev-list --count
grit reset --hard HEAD~3000git/git320 ms290 ms1.1×ok
grit reset --soft HEAD~50git/git30 ms0.0 ms—ok
grit rebase --onto master HEAD~1 (1 commit, 6.8k upstream commits)rust-lang/cargo864 ms306 ms2.8×slowhyperfine 8 runs; 2.8x, #2531
grit pick master~2000..lc (100 new-file commits)rust-lang/cargo12.63 s930 ms14×slow13.6x, #2532
grit pick lc (1 commit)rust-lang/cargo170 ms20 ms8.5×ok170 vs 20 ms, same cause as #2532
grit reset --hard origin/master (from HEAD~2000)rust-lang/cargo175 ms127 ms1.4×okhyperfine; 48 ms slower, just under threshold, not filed
grit merge <merge^2> (true merge)rust-lang/cargo30 ms90 ms0.3×oktree identical
grit tag / switch -crust-lang/cargo0.0 ms0.0 ms—ok
grit rebase / merge / pick / revert / reset / tag / history drop|move|reword|fixup|squash|undo (+ --json/--markdown)scratch s1..s12———okoutputs well-formed; fsck clean; change-ids preserved across history rewrites
grit pick --abort after git cherry-pick conflict (ORIG_HEAD present)scratch repro1———wrong#2529
grit pick/revert/rebase on detached HEADscratch s5———error#2530; git works
cargo build --release -p grit-cli (main 8cb4162ac)grit———error#2528
worked5
  • ›Merge (ff, --no-ff, --squash, --no-commit, --ff-only exit 128, --check/--dry-run), conflict stop + --abort/--continue, all with git-readable state and identical trees to git on real merges of git/git and cargo.
  • ›Rebase conflict flow (continue/skip/abort, --onto, -X ours/theirs, --check) with git status/fsck clean; grit refuses a git-started rebase with a clear message.
  • ›history drop/move/reword/fixup/squash/undo are atomic, keep change-ids and undo cleanly.
  • ›reset --hard reports orphaned commits with recovery hint; --dry-run and --json/--markdown outputs are consistent; tag listing/sorting/--contains/--points-at/--json correct.
  • ›Revert of 300 commits and rebase of 300 independent commits are as fast or faster than git.
problems12
  • ›FILED #2528: main (v0.5.29 release commit) does not compile (stash.rs `stored` undefined, Vec<u8> passed as &str); CI, Site and Tag release workflows red; the installer still serves 0.5.28.
  • ›FILED #2529: pick/revert --abort on a git-started cherry-pick/revert with stale ORIG_HEAD removes CHERRY_PICK_HEAD but leaves unmerged index, exit 0 (also release).
  • ›FILED #2530: pick, revert and rebase refuse a detached HEAD while merge/commit accept it.
  • ›FILED #2531: 1-commit rebase across thousands of upstream commits has a large fixed cost (cargo 864 ms vs 306 ms; git/git 1.7 s vs 0.5 s; +70-170 MB).
  • ›FILED #2532: grit pick of a range onto a diverged branch costs 40-125 ms/commit (cargo 100 commits 12.6 s vs git 0.93 s).
  • ›Not filed: conflict hunk boundaries differ slightly from git (blank-line placement, git's indent heuristic) on t/t1300-config.sh merge; content equivalent.
  • ›Not filed: `grit pick <merge>` without --mainline says 'pass --mainline <n> ... (not yet supported on the CLI)' although --mainline works (stale wording).
  • ›Not filed: `grit reset -- f1` errors with "revision 'f1' not found" (reset HEAD -- f1 gives a helpful restore --staged hint); `reset --keep` conflict message says 'before switching'.
  • ›Not filed: JSON/markdown nits: `merge --abort --json` returns branch "", `rebase --json` completed has head null, `merge --dry-run --markdown` says 'stopped with conflicts'.
  • ›Not filed: grit rebase replays merge commits (stops on conflicts at merge commits) where git drops them; -q is not accepted by init/switch/merge (deliberate small CLI).
  • ›Not filed: grit describe took 120 ms vs git 10 ms on git/git (about 110 ms, marginal) and prints the long form even on an exact tag match; git's describe distance is approximate (431 vs true 425), grit's is exact.
  • ›Not filed (unverified): git fsck shows a dangling blob after resolving a conflict via merge/rebase --continue; harmless.
bugs filed5
#2528 #2529 #2530 #2531 #2532
next time
  • ›Re-measure rebase/pick after the fixes for #2531/#2532 and profile where the per-commit and fixed cost goes (patch-id of all upstream commits vs base->ours diff/rename detection).
  • ›Test rebase of branches containing merges against git --rebase-merges, plus history split/absorb on larger repos.
  • ›Test revert/pick of merge commits with conflicts, and rename-heavy merges (directory renames) against git merge-ort.
  • ›Run the same scenarios on macOS and Windows, and with core.fsmonitor/untrackedcache and commit signing enabled (commit.gpgsign=true in the global config of this VM was not exercised).
  • ›Verify #2528 is fixed on main and re-run the full scenario with a pristine main build.