fix(git): patch just-git 1.9.1 with mode, ls-tree and --summary fixes

Closed
HA
4d ago
+1611-6

Why

The Databricks e2e run turned up five git gaps, all in just-git 1.9.1:

  • git status and git diff print nothing after chmod 644 on a committed 100755 file. git add and git commit still 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 755 merges as 100644 (blindmansion/just-git#18).
  • git ls-tree isn't implemented (blindmansion/just-git#12).
  • git show, git log and git diff reject --summary (blindmansion/just-git#19).

The fixes are open upstream, and none is merged or released:

Upstream PRFixesHead
blindmansion/just-git#15exec bit on checkout, mode-only changes in status, diff and branch switches (blindmansion/just-git#10)86ecf4b
blindmansion/just-git#20a merge keeps a mode change made on either side (blindmansion/just-git#18)eb31efd
blindmansion/just-git#14git 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.patch replaces dist/index.js and dist/repo/index.js with a build of the v1.9.1 commit (b509001) with the four PR heads merged in. Building v1.9.1 alone 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 the mode change lines 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 are ls-tree interop 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.yaml and pnpm-lock.yaml register 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.md lists what the patch carries and when to drop it.

Review notes

Testing

  • git-command.just-git-patch.test.ts runs real just-bash over SqlFs. Its 8 tests cover:

    • status and diff on 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 and HEAD: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, and HEAD: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 lint and pnpm security:audit pass.

  • pnpm verify:local passes: 265 integration tests, 92 HTTP/MCP contract checks and 102 live SDK checks.

  • Over Postgres, with the patch: git status shows M r.sh after a chmod, and git diff shows old mode 100755 / new mode 100644. Switching to the mode-only branch sets 644, and switching back sets 755. A merge of a chmod 755-only branch records 100755, 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.