Page MenuHomeFreeBSD

git-arc: Improve 'list' when a review exists
Needs ReviewPublic

Authored by jlduran_gmail.com on Fri, Sep 27, 2:08 AM.

Details

Reviewers
emaste
imp
markj
Summary

When a review exists in Phabricator, git-arc matches the first line of
the commit log with the title of the review. If there is a match, it
grabs the differential ID to query:

echo '{"names":["D12345"]}' | arc call-conduit -- phid.lookup

and gets the "status" (e.g., open, closed) as reported by the API
instead of displaying the output similar to the one produced by:

arc list --ansi

which appropriately shows a more accurate colored status (e.g.,
Accepted, Changes Planned, etc.)

Improve this by querying differential.revision.search, and
filtering the '.response.data[0].fields.status' response.

Also, bump the width to accommodate for "Changes Planned", which
contains 15 characters

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 59616
Build 56503: arc lint + arc unit

Event Timeline

jlduran_gmail.com created this revision.

Final patch in the series.

% git arc list main..fix-git-arc-consolidated
33118f4d8db4 No Review             : git-arc.sh: Fix typo s/Truning/Turning/
775a91cc76f6 Accepted        D46767: git-arc: Do not echo unescaped literals to jq
c305f7eb5215 Accepted        D46781: git-arc: Make patch with reviewers more portable
a75479fe401f Accepted        D46789: git-arc: Fix find_author() for external users
23587ac312ed Needs Review    D46804: git-arc: Improve 'list' when a review exists

I'm not really good at painting in the terminal. I hope there is a shorter way to achieve the same result.

The branch with all the commits (plus one trivial typo fix) is on GitHub: https://github.com/jlduran/freebsd-src/tree/fix-git-arc-consolidated

Minor fixes

  • Use arc_call_conduit() instead of arc call-conduit
  • Use the color name