document git add requirement for untracked files in commit pathspec - #124
Merged
Conversation
A commit pathspec matches only tracked paths, so any commit introducing a new file failed outright with 'did not match any file(s) known to git'. Adds the add-then-pathspec sequence and reconciles it with the existing 'git add alone is NOT sufficient' line.
There was a problem hiding this comment.
The diff is small and purely documentation: CHANGELOG.md (4 lines added) and commands/commit.md (11 lines added). The mechanical funnel confirmed 0 findings. This is a docs-only change — no code, no security-sensitive content, no toolchain needed.
Reviewing the changes:
CHANGELOG.md— Unreleased entry correctly formatted, describes the bug fix.commands/commit.md— New section documents a real git behavior: a commit pathspec only matches tracked files, so untracked (new) files must begit add-ed first. The sequence example is correct and includes a pre-flightgit diff --cached --name-onlycheck to avoid sibling-session collisions.
No issues found. The documentation accurately describes git behavior and the changelog follows the project's format.
{
"verdict": "approve",
"summary": "Docs-only change adding a CHANGELOG entry and documenting the requirement to git add untracked files before using a pathspec in git commit. Accurate, well-formed, no concerns.",
"comments": [],
"concerns_addressed": []
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
/coding:commit§ 2d mandatesgit commit -m "msg" -- <paths>and warns thatgit addalone is insufficient. Both true — but a commit pathspec matches only paths git already tracks, so a brand-new file is rejected outright:The whole commit fails. This hits every commit that introduces a new file, which is most feature work.
Fix
Documents the add-then-pathspec sequence, and explicitly reconciles it with the existing "
git addalone is NOT sufficient" line so the two do not read as contradictory. Includes a pre-check that the index holds nothing staged by a sibling session.Found while committing a rewritten command in
bborbe/claude.