As a hackathon/hackweek project, I wrote arc revise: a command that
automatically patches comments made on the differential web UI. I wanted to
send this to you to get some thoughts/feedback, but I'm not pushing for it
to be merged: I was just going to install it as a local extension and see how
well it works.
arc revise grabs all inline comments on the current differential revision, and
patches in any comment that starts with a code block (using the lint autofix
machinery).
- It patches comments created by anyone. Supports multi-line comments
- Right now, it patches comments on every diff, but it verifies that the original lines that were commented on are the same as the existing lines.
- TODO: You can reply to a comment with :disagree to prevent it from being patched (picked an arbitrary syntax that didn't conflict with phabricator's !commands.) I may have to be smart about handling comments that aren't technically replies but are on the same line.
- I need to better notify the user about what patches were dropped due to being outdated or disagreed.
- It runs arc amend first as a child workflow.
IMO, this could be one of the larger shifts in the
diff-comment-revise-accept-land worflow that we've had since diffcamp. I'll
know more as people actually try it out, though.
P.S. Despite the disclaimer, its plausible to merge this upstream as a flag on
arc amend (e.g. arc amend --patch-comments), especially if its called out as
a prototype in help. I'm interested in first seeing how well this works in
practice, though.