fix(git): patch just-git 1.9.1 with mode, ls-tree and --summary fixes
Why
The Databricks e2e run turned up five git gaps, all in just-git 1.9.1:
git statusandgit diffprint nothing afterchmod 644on a committed100755file.git addandgit commitstill record the change, so it gets committed without anyone seeing it.- Switching to a branch where a file differs only in its exec bit leaves the old mode on disk (blindmansion/just-git#10).
- A merge drops a mode change made on one side. A branch that only runs
chmod 755merges as100644(blindmansion/just-git#18). git ls-treeisn't implemented (blindmansion/just-git#12).git show,git logandgit diffreject--summary(blindmansion/just-git#19).
The fixes are open upstream, and none is merged or released:
| Upstream PR | Fixes | Head |
|---|---|---|
| blindmansion/just-git#15 | exec bit on checkout, mode-only changes in status, diff and branch switches (blindmansion/just-git#10) | 86ecf4b |
| blindmansion/just-git#20 | a merge keeps a mode change made on either side (blindmansion/just-git#18) | eb31efd |
| blindmansion/just-git#14 | git ls-tree, including <rev>:<path> (blindmansion/just-git#12) | 597c81e |
| blindmansion/just-git#21 | --summary in show, log and diff (blindmansion/just-git#19) | c448cdf |
This PR carries all four as a pnpm patch until they're released.
What changed
patches/just-git@1.9.1.patchreplacesdist/index.jsanddist/repo/index.jswith a build of thev1.9.1commit (b509001) with the four PR heads merged in. Buildingv1.9.1alone gives JS byte-identical to the npm package, so the patch contains only the four PRs. Like the just-bash patch it is large (1.1 MB), because the dist files are minified and long lines change as a whole.- blindmansion/just-git#20 and blindmansion/just-git#21 both edit
src/lib/commit-summary.ts. blindmansion/just-git#21 moves the summary lines into one shared formatter that already prints themode changelines blindmansion/just-git#20 adds, so the build takes blindmansion/just-git#21's version of that file. With all four merged, just-git's suite gives 3,734 pass, 29 skip and 2 fail. The 2 failures arels-treeinterop cases that check git's empty-pathspec errors. They fail the same way on the blindmansion/just-git#14 branch alone, because this machine has git 2.34.1 and the expected output comes from a newer git. pnpm-workspace.yamlandpnpm-lock.yamlregister the patch.src/api/commands/git-command.ts: comments only. With the patch, just-git sets every mode itself. On sql-fs over Postgres, a clean merge and a conflicted merge give the same modes with and without the wrapper's index-mode repair. The repair stays as a fallback, and the comment says to remove it once a just-git release includes blindmansion/just-git#15 and blindmansion/just-git#20.AGENTS.mdlists what the patch carries and when to drop it.
Review notes
- Codex (P2),
git ls-tree HEAD:src: valid. blindmansion/just-git#14 now resolves<rev>:<path>like git, checked against real git in 23 new interop cases. The fix is in blindmansion/just-git#14, and the rebuilt patch includes it. - CodeRabbit, merge mode at patch line 1344: that is blindmansion/just-git#18. blindmansion/just-git#20 fixes it, and the patch now includes blindmansion/just-git#20.
- CodeRabbit,
ls-treecoverage: the sql-fs test now also checks-r, a path filter andHEAD:srcagainst a nested tree. The output matches real git.
Testing
-
git-command.just-git-patch.test.tsruns real just-bash over SqlFs. Its 8 tests cover:statusanddiffon a chmod-only change;- a mode-only branch switch in both directions, and the refusal to switch over a local chmod;
git ls-tree, with-r, a path filter andHEAD:src;- a merge of a mode-only change;
- the mode of a conflicted file;
git show --summary.
On unpatched 1.9.1 all 8 fail. On the previous patch (blindmansion/just-git#14 and blindmansion/just-git#15 only), 3 fail: the mode-only merge,
--summary, andHEAD:src. The conflicted-merge test passes there, because the wrapper's repair covers that case. -
pnpm check(2,313 unit and 152 TypeScript SDK tests),pnpm lintandpnpm security:auditpass. -
pnpm verify:localpasses: 265 integration tests, 92 HTTP/MCP contract checks and 102 live SDK checks. -
Over Postgres, with the patch:
git statusshowsM r.shafter a chmod, andgit diffshowsold mode 100755/new mode 100644. Switching to the mode-only branch sets 644, and switching back sets 755. A merge of achmod 755-only branch records100755, as real git does.
Not covered
The upstream PRs list their own open edge cases. These include modes in rename plus add/add and rename/delete, file/symlink type changes, and --compact-summary.