reviewdiff: Parse review comment patches - #1162
Merged
Merged
Conversation
Collaborator
Author
|
This change is part of the following stack: Change managed by git-spice. |
This was referenced May 14, 2026
ed-irl
force-pushed
the
branch-comment-forge
branch
from
June 2, 2026 18:58
c8dd0d1 to
89378af
Compare
This was referenced Jun 2, 2026
ed-irl
force-pushed
the
branch-comment-forge
branch
3 times, most recently
from
June 8, 2026 10:18
e17e522 to
47eb920
Compare
ed-irl
force-pushed
the
branch-comment-forge
branch
2 times, most recently
from
June 13, 2026 13:39
febcc09 to
8648c7a
Compare
Owner
|
working on merging functionality from this stack next |
abhinav
force-pushed
the
branch-comment-forge
branch
from
June 14, 2026 04:05
8648c7a to
0719a4f
Compare
This was referenced Jun 14, 2026
abhinav
force-pushed
the
branch-comment-forge
branch
2 times, most recently
from
June 14, 2026 04:30
c8254f9 to
dabcd6f
Compare
abhinav
pushed a commit
that referenced
this pull request
Jun 14, 2026
The comments CLI needs a local representation for inline comments that have been prepared but not submitted to a forge yet. Staged comments now persist the target path, line range, body, diff side, and optional thread identifier in the spice state database. That gives command code a stable state boundary before it batches the comments into a forge review. Extracted from #1162
ed-irl
force-pushed
the
branch-comment-forge
branch
from
June 15, 2026 09:52
dabcd6f to
1d76154
Compare
ed-irl
force-pushed
the
branch-comment-forge
branch
from
June 19, 2026 01:03
1d76154 to
5e57d40
Compare
ed-irl
force-pushed
the
branch-comment-forge
branch
from
June 24, 2026 01:32
5e57d40 to
b382179
Compare
Review comments are entered against working-tree lines, while forges anchor them to positions in a change diff. Add `diffmap.Mapper` to bridge those coordinates. Persist staged comments by branch so upstack commands can assemble and edit a review before submission.
Review comment anchors need postimage membership before submission, while ShamHub staleness needs to know whether an old-side line was deleted. The previous mapper coupled those questions to working-tree coordinates and always returned the right side. Parse Git patches into explicit membership and deletion queries. Line ranges must fit within one postimage fragment, and deletion ranges report only removed old-side lines. Staged-comment persistence moves to the command branch that owns its lifecycle.
abhinav
force-pushed
the
branch-comment-forge
branch
from
August 24, 2026 05:14
b382179 to
d2f5157
Compare
abhinav
force-pushed
the
branch-comment-forge
branch
2 times, most recently
from
August 24, 2026 05:18
9319b93 to
d2f5157
Compare
abhinav
added a commit
that referenced
this pull request
Aug 30, 2026
ShamHub review threads record the change head in `ReviewThread.CommitHash`. When that revision differs from the current head, compare the two revisions and mark a right-side thread outdated only when the later patch deletes a line in its inclusive range. Insertions alone do not stale an anchor. File-level and left-side threads retain their stored state because their recorded coordinates do not identify a comparable source range. Explicitly seeded outdated state still takes precedence, and diff or parsing failures propagate to the caller. This builds on the review patch queries from #1162. The user-facing staleness script is included with the commands in #1163. --------- Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
This was referenced Sep 1, 2026
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.
Review comment commands need to check postimage anchors before submission, while ShamHub staleness needs to determine whether later revisions delete anchored lines.
Add
reviewdiff.Patch, backed bygo-gitdiff, to parse a Git patch once and answer file, line, inclusive-range, and source-line deletion queries. A requested range must fit within one postimage fragment, while deletion queries report only lines actually removed from the source side.The forge API and provider implementations previously carried by this PR are now provided by #1411 through #1417. Staged comment persistence moves to #1163.