branch comment: Support file and line-range anchors - #1223
Closed
ed-irl wants to merge 8 commits into
Closed
Conversation
Collaborator
Author
|
This change is part of the following stack: Change managed by git-spice. |
ed-irl
force-pushed
the
branch-comment-stale
branch
from
June 2, 2026 20:08
13fcb5b to
ce6c1aa
Compare
ed-irl
force-pushed
the
branch-comment-scopes
branch
from
June 2, 2026 20:14
2f2d7a9 to
673dc16
Compare
This was referenced Jun 2, 2026
ed-irl
force-pushed
the
branch-comment-stale
branch
from
June 2, 2026 22:20
5582ec7 to
ee1f597
Compare
ed-irl
force-pushed
the
branch-comment-scopes
branch
from
June 2, 2026 22:30
673dc16 to
3c58177
Compare
ed-irl
force-pushed
the
branch-comment-stale
branch
from
June 8, 2026 10:18
ee1f597 to
9f8657d
Compare
ed-irl
force-pushed
the
branch-comment-scopes
branch
from
June 8, 2026 10:19
3c58177 to
75e05c0
Compare
ed-irl
force-pushed
the
branch-comment-stale
branch
from
June 8, 2026 11:15
1113e5d to
312db25
Compare
ed-irl
force-pushed
the
branch-comment-scopes
branch
from
June 8, 2026 11:15
e46ecf6 to
658c245
Compare
ed-irl
force-pushed
the
branch-comment-stale
branch
from
June 12, 2026 20:07
312db25 to
6ab1da8
Compare
ed-irl
force-pushed
the
branch-comment-scopes
branch
from
June 12, 2026 20:07
658c245 to
9b32be2
Compare
ed-irl
force-pushed
the
branch-comment-stale
branch
from
June 13, 2026 13:39
6ab1da8 to
167cca4
Compare
ed-irl
force-pushed
the
branch-comment-scopes
branch
from
June 13, 2026 13:39
9b32be2 to
b8a0e76
Compare
ed-irl
force-pushed
the
branch-comment-stale
branch
from
June 15, 2026 09:52
167cca4 to
d049480
Compare
ed-irl
force-pushed
the
branch-comment-scopes
branch
from
June 15, 2026 09:53
b8a0e76 to
9bb9a70
Compare
ed-irl
force-pushed
the
branch-comment-stale
branch
from
June 19, 2026 01:04
41864dd to
93682d9
Compare
ed-irl
force-pushed
the
branch-comment-scopes
branch
from
June 19, 2026 01:04
00e9ec6 to
ed5caa4
Compare
ed-irl
force-pushed
the
branch-comment-stale
branch
from
June 24, 2026 01:32
93682d9 to
e8e87b4
Compare
ed-irl
force-pushed
the
branch-comment-scopes
branch
from
June 24, 2026 01:32
62a5aa0 to
204ded0
Compare
abhinav
force-pushed
the
branch-comment-stale
branch
from
August 24, 2026 05:14
e8e87b4 to
4b111e1
Compare
abhinav
changed the base branch from
branch-comment-stale
to
branch-comment-commands
August 24, 2026 05:15
abhinav
force-pushed
the
branch-comment-scopes
branch
from
August 24, 2026 05:15
204ded0 to
4953073
Compare
abhinav
force-pushed
the
branch-comment-commands
branch
from
August 24, 2026 12:40
916ca7d to
4de3ce3
Compare
abhinav
force-pushed
the
branch-comment-scopes
branch
from
August 24, 2026 12:40
4953073 to
173edc0
Compare
abhinav
force-pushed
the
branch-comment-commands
branch
from
August 24, 2026 12:46
4de3ce3 to
836926e
Compare
abhinav
force-pushed
the
branch-comment-scopes
branch
from
August 24, 2026 12:48
173edc0 to
4a6e992
Compare
abhinav
force-pushed
the
branch-comment-commands
branch
from
August 30, 2026 17:54
836926e to
b5b0780
Compare
abhinav
force-pushed
the
branch-comment-scopes
branch
from
August 30, 2026 17:54
4a6e992 to
d32a5a7
Compare
Store single-line review comments by branch so branch comment commands can assemble, edit, and submit a review across invocations. Local integer IDs address drafts before the forge assigns review thread and comment IDs. The persisted shape intentionally retains the original single-line anchor contract. File-level and line-range staging remain a separate design decision.
Add `gs branch comment` for posting and managing review feedback. The command group can list remote threads, stage and batch comments into a review, reply to or edit comments, and resolve threads. Forge IDs are opaque values rather than strings. Recover IDs from `ReviewRepository.ListReviewThreads` before reply, edit, or resolution operations.
Exercise `gs branch comment` workflows against ShamHub. The scripts keep command parsing, staged state, diff mapping, and forge operations inside one end-to-end boundary. They cover immediate and staged submission, listing and JSON output, staged editing, and review-thread discovery.
Exercise the user-visible outdated status after a later ShamHub revision deletes one anchored line while preserving another. Cover both the human-readable list and extension-facing JSON output.
Branch comment locations are coordinates in the selected branch postimage. Check single-line anchors against `reviewdiff.Patch` before submission, retain the requested path and line, and submit them on the right side of the review diff. This removes the working-tree mapping and textual side conversion from immediate and staged submission. Staged state remains single-line; file and range staging are deferred to their own contract.
Move review-comment management from gs branch comment to the top-level gs review namespace. Comments and replies now default to local drafts and use --no-draft for immediate posting. Publish sends drafts as one review, while list, edit, resolve, and reopen expose the remaining workflows with numeric draft references. Keep the draft default fixed and retain the existing ID lifecycle. Persistent allocation, deletion, configurable defaults, and staged file or range anchors remain separate review units.
`gs branch comment add` now accepts a file, an inclusive `file:start-end` range, or `--pr` for an unanchored review body. Single-line `file:line` anchors remain supported. `--pr` uses `SubmitReviewRequest.Body`. Because `ListReviewThreads` does not return review bodies, PR-level comments do not appear in `gs branch comment list`.
Accept immediate review comments anchored to a whole file, one line, or an inclusive line range. Parse those forms into a typed review-thread range and check the complete anchor against the selected branch patch before submission. Drop `--pr` because review bodies are not returned by `ListReviewThreads` and overlap ordinary change comments. Staged comments retain their existing single-line syntax until their persistence and lifetime contracts are decided.
abhinav
force-pushed
the
branch-comment-commands
branch
from
August 30, 2026 22:04
b5b0780 to
8b8bb59
Compare
abhinav
force-pushed
the
branch-comment-scopes
branch
from
August 30, 2026 22:04
d32a5a7 to
02e5ccc
Compare
abhinav
force-pushed
the
branch-comment-commands
branch
from
August 30, 2026 22:25
8b8bb59 to
31f7350
Compare
Owner
|
Folding into #1163 |
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.
Extend immediate
gs branch comment addrequests from one line to three anchor forms: a whole file, one line, or an inclusive line range.Parse the command argument into a typed
ReviewThreadRange, check the complete postimage anchor withreviewdiff.Patch, and submit line anchors on the right side of the review diff. File anchors use the zero range defined by the forge review API.The earlier
--prform is removed because review bodies are not returned byListReviewThreadsand overlap ordinary change comments. Staged comments retain their existing single-line syntax until their persistence and lifetime contracts are decided separately.