Swept

shared worktree · commit safety

Two ways to make a commit, and they are opposites. Paste your git status --porcelain, tick what you mean to commit, and this says which form takes work that is not yours along with it. There is no safe default form: safety is a property of the tree, not of the command.

1 · paste git status --porcelain

Porcelain v1 only. Two status columns, then the path. X is the index against HEAD, Y is the working tree against the index.

2 · tick what you are committing

3 · the verdict

The measured matrix, and how it was measured

Every cell below was produced by building a throwaway repository, running the real sequence with the real git binary, and reading what actually landed in the commit. Nothing here is quoted from a document. The script is _verify/measure_git_matrix.js and it re-runs in about a second.

The order is what makes it a fair test: my change is staged first, then the peer's work appears, then I commit. Get that ordering wrong and every row comes out looking safe.

The other session's work Tree reads git commit -- A git commit

Read the row where both forms sweep. Once a peer stages into a file you are also committing, the index and the working tree agree again, so the tree reads and looks exactly like your own ordinary staged work. No command excludes their hunk and no amount of parsing detects it. That row is the one this tool answers with "go and read the diff", because that is the only thing that works.

What this tool cannot do, stated plainly. Git stores no authorship for an uncommitted change. So it can tell you a file holds content your index does not, and it can never tell you who put it there. Every verdict is about state.