2 .\" SPDX-License-Identifier: BSD-2-Clause
4 .\" Copyright (c) 2021 Daniel Ebdrup Jensen
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd a wrapper to improve integration between git and arcanist
37 .Op Fl r Ar reviewer1 Ns Op Cm \&, Ns Ar reviewer2 ...
38 .Op Fl s Ar subscriber1 Ns Op Cm \&, Ns Ar subscriber2 ...
40 .Op Ar commit ... Ns | Ns Ar commit-range
42 .Cm list Ar commit ... Ns | Ns Ar commit-range
46 .Ar diff1 Ns Op Cm \&, Ns Ar diff2
50 .Op Ar commit ... Ns | Ns Ar commit-range
54 .Op Ar commit ... Ns | Ns Ar commit-range
58 utility creates and manages
60 Phabricator reviews based on git commits.
63 assumes a one-to-one relationship between git commits and
64 Differential Revisions, and the Differential Revision title must match
65 the summary line of the corresponding commit.
66 In particular, the commit summaries must be unique across all open
67 Differential Revisions authored by the submitter.
69 The first parameter must be a verb.
70 The available verbs are:
71 .Bl -tag -width "create"
73 Create new Differential Revisions from the specified commits.
75 .Bl -tag -width subscriber
77 Before processing commit(s) display list of commits to be processed
78 and wait for confirmation.
80 Add one or more reviewers, separated by commas, to revision(s) being created.
81 Argument(s) must be existing Phabricator user or group.
82 .It Fl s Ar subscriber
83 Add one or more subscribers, separated by commas, to revision(s) being created.
84 Each argument must be an existing Phabricator user or group.
86 Specify the parent of the first commit in the list.
87 This is useful when adding more commits on top of the already existing
91 Print the associated Differential Revisions for the specified commits.
93 Try to apply a patch from a Differential Revision to the currently
96 Prepare a series of commits to be pushed to the upstream
99 The commits are cherry-picked to a branch (by default the
101 branch), review tags are added to the commit log message, and
102 the log message is opened in an editor for any last-minute
104 The commits need not have associated Differential
107 Synchronize the Differential Revisions associated with the
109 Currently only the diff is updated; the review description and other
110 metadata are not synchronized.
111 If a message is specified with
113 that message is added as a note to the Differential Revision.
114 If no message is supplied,
115 the user's editor will be opened to provide an update message for
117 If an empty message is supplied via
119 then no notes will be added when updating Differential Revisions.
122 These are manipulated by
124 .Bl -tag -width "arc.assume_yes"
125 .It Va arc.assume_yes
128 answer to all prompts instead of
135 Try to open newly created reviews in a browser tab.
142 In this mode, the list of git revisions to create reviews for
143 is listed with a single prompt before creating reviews.
144 The diffs for individual commits are not shown.
147 Always use verbose output.
154 The typical end-to-end usage looks something like this.
156 Commit changes with a message and create a Differential Review:
157 .Bd -literal -offset indent
158 $ git commit -m "kern: Rewrite in Rust"
159 $ git arc create HEAD
162 Make changes to the diff based on review feedback, then amend the
163 changes to the existing commit and update the Differential Review:
164 .Bd -literal -offset indent
166 $ git arc update HEAD
169 Now that all reviewers are happy, it is time to stage the commit and
171 .Bd -literal -offset indent
173 $ git push freebsd HEAD:main
176 Create a Phabricator review using the contents of the most recent
177 commit in your git checkout:
178 .Bd -literal -offset indent
179 $ git arc create -r markj HEAD
182 The commit title is used as the review title, the commit log
183 message is used as the review description, and
184 .Aq Mt markj@FreeBSD.org
185 is added as a reviewer.
187 Create a series of Phabricator reviews for each of HEAD~2, HEAD~ and
189 .Bd -literal -offset indent
190 $ git arc create HEAD~3..HEAD
193 Pairs of consecutive commits are linked into a patch stack.
194 Note that the first commit in the specified range is excluded.
196 Create a series of separate reviews for each of the following commits:
197 .Bd -literal -offset indent
198 $ git arc create b409afcfedcdda ca03ed1345aff0
201 Update the review corresponding to commit b409afcfedcdda:
202 .Bd -literal -offset indent
203 $ git arc update b409afcfedcdda
206 The title of the commit must be the same as it was when the review
208 Note that the review description is not automatically updated.
210 Apply the patch in review D12345 to the currently checked-out tree,
212 .Bd -literal -offset indent
213 $ git arc patch D12345
216 Apply the patch in review D23456 to the currently checked-out tree,
217 and commit it to the tree with the commit message in the review and
218 make the best guess for what to use for author.
219 If the guess is considered unreliable, the user is prompted to see
220 if they wish to use it (or abort).
221 .Bd -literal -offset indent
222 $ git arc patch -c D23456
225 List the status of reviews for all the commits in the branch
227 .Bd -literal -offset indent
228 $ git arc list main..feature
236 utility appeared in the src tools collection in
241 utility was written by
243 .An Mark Johnston Aq Mt markj@FreeBSD.org
244 and the manual page was written by
245 .An Daniel Ebdrup Jensen Aq Mt debdrup@FreeBSD.org .