Skip to content

chore(tools): Exclude intent-to-add files from git_diff staged output#482

Merged
JeanMertz merged 2 commits intomainfrom
prr53
Mar 26, 2026
Merged

chore(tools): Exclude intent-to-add files from git_diff staged output#482
JeanMertz merged 2 commits intomainfrom
prr53

Conversation

@JeanMertz
Copy link
Copy Markdown
Collaborator

When a file is staged with git add --intent-to-add, it appears in git diff-index output as a zero-sized blob, polluting the staged diff with files that have no actual staged content. This caused the git_diff tool and the committer persona's diff attachment to include ITA entries alongside genuinely staged changes.

Adding --ita-invisible-in-index to all diff-index invocations suppresses these ITA entries so only real staged hunks are reported. The committer persona's diff attachment command is updated to match.

When a file is staged with `git add --intent-to-add`, it appears in `git
diff-index` output as a zero-sized blob, polluting the staged diff with
files that have no actual staged content. This caused the `git_diff`
tool and the committer persona's diff attachment to include ITA entries
alongside genuinely staged changes.

Adding `--ita-invisible-in-index` to all `diff-index` invocations
suppresses these ITA entries so only real staged hunks are reported. The
committer persona's diff attachment command is updated to match.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
…ed output

Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz merged commit 4257474 into main Mar 26, 2026
12 checks passed
@JeanMertz JeanMertz deleted the prr53 branch March 26, 2026 22:55
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