Skip to content

Committing when not the only writer: stage a new file by exact name first - #35

Merged
yamierick merged 1 commit into
mainfrom
petition/committing
Oct 1, 2026
Merged

yamierick merged 1 commit into
mainfrom
petition/committing

Conversation

@yamierick

Copy link
Copy Markdown
Contributor

Why

The section's remedy for a shared index, git commit -m "..." -- <paths>, fails on a file git has never seen (pathspec ... did not match any file(s) known to git). A new file is the commonest commit in a notebook repository, and the natural recovery, git add then a plain commit, is the exact pattern the section forbids. Staging your own new file by exact name and then committing with the same paths works, and still leaves another session's staged files out (verified in a scratch repository on 2026-09-24). Staging by directory does not: git add -A <dir> takes other sessions' untracked files, because a path scope cannot express authorship.

Sightings

Two independent sweeps (2026-09-07 and 2026-09-24), each committing another session's new file under the wrong message. Both broke a rule the standard already states, so this is filed as a defect in the remedy, not a new rule; one sighting suffices. The closing push sentence rests on one sighting and is marked optional in the text itself.

What changes

  • Part 12, Committing when you are not the only writer: two paragraphs and a two-line example after the 2026-09-02 verification, before "Otherwise:".

Approved by Jones on 2026-09-24. Drafted in claude-notes: briefings/petition-carry-forward-2026-09-24b.md item 4.

🤖 Generated with Claude Code

…ct name first

Fixes a defect in "Committing when you are not the only writer". The
prescribed `git commit -- <paths>` refuses a file git has never seen, and the
natural recovery (git add, then a plain commit) is the pattern the section
forbids. Both recorded sweeps happened on new files. The fix: stage your own
new files by exact name, then commit with the same paths. Also: never stage
by directory in a shared repo (`git add -A <dir>` takes other sessions'
untracked files), and, marked optional on one sighting, read
`git log origin/<branch>..HEAD` before pushing from a shared clone.

Petition: claude-notes briefings/petition-carry-forward-2026-09-24b.md item 4;
approved by Jones 2026-09-24.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yamierick
yamierick merged commit 0212cd4 into main Oct 1, 2026
@yamierick
yamierick deleted the petition/committing branch October 1, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant