Skip to content

fix: add support for intent-to-add ([ A]) git status code#141

Merged
mroth merged 1 commit intomainfrom
mroth/push-nkqztkmttsqn
Feb 21, 2026
Merged

fix: add support for intent-to-add ([ A]) git status code#141
mroth merged 1 commit intomainfrom
mroth/push-nkqztkmttsqn

Conversation

@mroth
Copy link
Owner

@mroth mroth commented Feb 21, 2026

Summary

  • Add ChangeUnstagedNewFile variant to handle the [ A] porcelain status code produced by git add -N (intent-to-add) and Jujutsu colocated repos
  • Add regression test from user-submitted debug dump (Unsupported new git status change code: [ A] #86) with both v1 and v2 porcelain fixtures
  • Add rendering test and golden files for the new change type
  • Update embedded git status XY code documentation to match current git docs

Closes #86, closes #53

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for the git status porcelain XY code [ A] (intent-to-add via git add -N) by introducing a new ChangeType and wiring it through parsing + rendering tests, along with updated parsing documentation.

Changes:

  • Add ChangeUnstagedNewFile and map it to display metadata (message/state/group).
  • Extend porcelain v1 decoding to recognize y == 'A' as an unstaged “new file” (intent-to-add), plus regression fixtures/tests.
  • Add renderer golden tests/fixtures and update git status XY documentation references.

Reviewed changes

Copilot reviewed 10 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/gitstatus/gitstatus.go Adds new ChangeType variant and display metadata.
internal/gitstatus/porcelainv1/process.go Updates embedded XY documentation and adds .A/[ A] decoding path.
internal/gitstatus/porcelainv1/process_test.go Adds unit coverage for extracting change types from " A".
internal/gitstatus/porcelainv1/golden_test.go Adds regression test case using issue #86 fixture; refactors fixture root selection.
internal/gitstatus/testdata/issue86.* Adds user-submitted regression fixtures (v1/v2, text and -z forms).
internal/gitstatus/porcelainv1/testdata/*.porcelain-v1z.bin Adds binary -z fixtures used by golden tests.
internal/cmd/status/render_test.go Adds rendering test case for the new unstaged “new file” change type.
internal/cmd/status/testdata/statuslist-intent_to_add.*.golden Adds golden outputs for the new render test case.
docs/git-status-parsing.md Updates ChangeType count/table to include the new variant.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Add ChangeUnstagedNewFile variant to handle the [ A] porcelain status
code produced by `git add -N` and jujutsu colocated repos.

Closes #86, closes #53

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 14 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mroth mroth merged commit 281696c into main Feb 21, 2026
19 checks passed
@mroth mroth deleted the mroth/push-nkqztkmttsqn branch February 21, 2026 02:35
mroth added a commit that referenced this pull request Feb 21, 2026
These were the last two currently known unhandled XY codes from the git
status short format. ` R` and ` C` caused a fatal parse error; compound
codes like `MR` or `CR` silently dropped the unstaged rename/copy.
Follows the same pattern established in #141 for intent-to-add [.A].

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
mroth added a commit that referenced this pull request Feb 21, 2026
These were the last two currently known unhandled XY codes from the git
status short format. ` R` and ` C` caused a fatal parse error; compound
codes like `MR` or `CR` silently dropped the unstaged rename/copy.
Follows the same pattern established in #141 for intent-to-add [.A].

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
mroth added a commit that referenced this pull request Feb 21, 2026
…des (#142)

These were the last two currently known unhandled XY codes from the git
status short format. ` R` and ` C` caused a fatal parse error; compound
codes like `MR` or `CR` silently dropped the unstaged rename/copy.
Follows the same pattern established in #141 for intent-to-add [.A].

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

Unsupported new git status change code: [ A] Unable to parse git status after using git add . -N

2 participants