Skip to content

enhance: query local changes with git status --porcelain=v2 -z - #2872

Open
bertyhell wants to merge 4 commits into
sourcegit-org:developfrom
bertyhell:perf/status-porcelain-v2
Open

bertyhell wants to merge 4 commits into
sourcegit-org:developfrom
bertyhell:perf/status-porcelain-v2

Conversation

@bertyhell

@bertyhell bertyhell commented Nov 9, 2026 •

Copy link
Copy Markdown
image

The porcelain v1 output parsed before is line based and C-quotes paths
containing special characters (", \, tab, newline...), and renames are
reported as old -> new text. Such paths were shown and used with their
escape sequences (e.g. quo\"te.txt), and a path containing -> could be
split wrongly.

Use the NUL-separated porcelain v2 format instead: paths are never quoted
and the original path of a rename/copy is a separate field. Every status
combination maps to the same ChangeState/ConflictReason as before.

🤖 Generated with Claude Code

claude and others added 2 commits November 9, 2026 08:10
The porcelain v1 output parsed before is line based and C-quotes paths
containing special characters (`"`, `\`, tab, newline...), and renames are
reported as `old -> new` text. Such paths were shown and used with their
escape sequences (e.g. `quo\"te.txt`), and a path containing ` -> ` could be
split wrongly.

Use the NUL-separated porcelain v2 format instead: paths are never quoted
and the original path of a rename/copy is a separate field. Every status
combination maps to the same `ChangeState`/`ConflictReason` as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KCxH1zwDXLd9kfAAkcf6PZ
- Read all output at once
- Only create change object when it is needed
@love-linger

Copy link
Copy Markdown
Collaborator

@JC-Chung Can you review and test this PR?

Comment thread src/Commands/QueryLocalChanges.cs Resolved
Comment thread src/Commands/QueryLocalChanges.cs Resolved
…`->` (sourcegit-org#2872)

(cherry picked from commit 2de3e6c532059a1861aa1503c8d28afa89bdbb2b)
@love-linger

Copy link
Copy Markdown
Collaborator

I've pushed another commit that no longer use Set(Index, Worktree) to automatically set Path and OriginalPath by splitting string with \t or ->.

This branch has not been deployed

No deployments
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.

4 participants