There Is One Index Per Repository
This is the fact everybody knows and nobody applies. The staging area is repository state, not session state. When three sessions work in one checkout, they share it — and the polite-looking move of scoping a commit to your own paths protects less than it looks like it does. Be precise about which half works, because getting this backwards is common: a commit given paths does disregard whatever else is staged, and that half is documented and reliable. What it cannot do is protect you within a file you named, where it commits the working tree — a neighbor's half-finished edit included. And building the commit the ordinary way still runs git add against the shared index, so your staging rewrites theirs.
The measured version: a session scoped its commit to its own paths while a neighbor had ninety-two files staged. The neighbor's set stayed out of the commit, exactly as documented — and the session still could not ignore it, because every add it made was written into the index that neighbor was working in.
Two Reasons to Reach for Plumbing
The fix is to build the commit without touching the shared index at all, using the low-level operations that let you point at a scratch index file instead.
Isolation. Start from a chosen base tree, add exactly your paths, write a tree, create a commit object. The shared index is never read and never written, so a neighbor's staged work cannot travel with you and your commit cannot disturb theirs.
No hooks. Plumbing does not fire the pre-commit hook. When that hook does genuine but expensive work — regenerating assets, syncing to an external service — every commit becomes a multi-minute operation holding the lock file everyone else needs. Routing the automated landing around it took landings from minutes to seconds, while ordinary commits by a person kept their hooks and the work the hooks were doing.
Moving the Branch Safely
Creating the commit object does not move anything; the branch reference still has to be updated. Do that with a compare-and-swap: update the reference only if it still points where it did when you started. If somebody else moved it in between, the update fails cleanly, and the correct response is to rebuild on the new tip rather than to force.
One more check belongs before the reference moves: verify that the commit's file list is a subset of the paths this operation was allowed to touch. It is cheap, it catches the case where a path pattern matched more than intended, and it is the difference between a landing that quietly swept in an unrelated file and one that refused.