Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jan 2021 12:58:00 -0500
From:      Mark Johnston <markj@freebsd.org>
To:        freebsd-hackers@freebsd.org
Subject:   arc wrapper for tracking phabricator reviews
Message-ID:  <YA8GqMhMxw6VSYu8@raichu>

next in thread | raw e-mail | index | archive | help
Hi,

For the past while I've been using a script, git arc, to automate some
of my interactions with Phabricator.  A few other developers have found
it useful so it seems time to make it more accessible by committing it
to the src tree.

The script is here: https://reviews.freebsd.org/D28334

The basic idea is to make it simple to create and update Phabricator
reviews from git commits, without adding any metadata to your git
repository so as to stay as flexible as possible.  In particular, I tend
to rebase sets of commits regularly so things like notes and branch
pointers end up being invalidated.

git arc lets you
- Create reviews from a series of commits.  It automatically creates
  parent/child pointers between consecutive Differential revisions.
- Update reviews after amending commits based on reviewer feedback.
- Stage commits in preparation for pushing to the upstream repository.
  This automatically adds "Reviewed by:" and "Differential Revision:"
  tags.
See the rather verbose usage message for more details.

To map git commits to phabricator revisions it uses commit summaries.
This is kind of gross but I don't see a better way to do it that doesn't
involve adding metadata to my git tree, and it seems to work fine in
practice.  In general git arc wraps the functionality of arc, though in
some cases it uses jq and arc's "call-conduit" functionality to call
into the lower-level Phabricator APIs.

There exists a script with similar goals, arcgit, in the tools/ dir.  I
used it for a while but found that with its workflow I still had to do a
fair bit of manual work to keep phabricator in sync with my commits.
I'm not sure how best to reconcile the two scripts.  It would be better
for new developers to not have to choose between them.  The main
advantage of arcgit is that it helps maintain large patch stacks by
making it easier to edit intermediate commits in response to review
feedback.  In particular, it adds a branch for each review posted to
phabricator, so it's a bit easier to go back and edit a particular
commit, but I believe this assumes that you aren't rebasing your branch.

I'd appreciate any feedback/suggestions/complaints regarding the new
script, especially if you use arcgit today.

Thanks to jhb for submitting a number of improvements and suggesting a
few others that I implemented recently.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YA8GqMhMxw6VSYu8>