1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
git-phab(1)
=============
NAME
----
git-phab - Git subcommand to integrate with phabricator.
SYNOPSIS
--------
[verse]
*git phab attach* [-h] [--reviewers '<username1,#project2,...>']
[--cc '<username1,#project2,...>'] [--message '<message>']
[--task '<T123>'] [--remote <remote>] [--assume-yes]
[--projects '<project1,project2,...>']
['<revision range>']
*git phab log* [-h] [<revision range>]
*git phab fetch* [-h] ['<T123>']
*git phab checkout* [-h] ['<T123>']
*git phab browse* [-h] ['objects' ['objects' ...]]
*git phab clean* [-h]
*git phab land* [-h] [--no-push]
DESCRIPTION
-----------
Provides integration for projects using Phabricator.
The current repository must contain a valid `.arcconfig` file and a remote
location to push submitted branches must be defined using:
git config phab.remote <remote>
COMMANDS
--------
*attach*::
Creates a new differential for each commit in the provided '<revision_range>'.
Commit messages will be rewritten to include the URL of the newly created
Differential (no other information will be added to the message). If a commit
message already contains the URL of a Differential it will be updated instead of
creating a new one.
+
'<revision_range>' can be either a range of commits or a single commit, as
understood by `git rev-parse`. If omitted, the default range is from the remote
current branch's remote tracking commit to HEAD.
+
With `--task` option, or if current branch is in the form `Txxx-description`,
it will also push the current HEAD into `wip/phab/Txxx-description` on the
configured remote repository. If the phabricator instance supports the
`std:maniphest:git:uri-branch` extention, the remote branch URI will be linked
on the Maniphest.
+
If not task is defined, it will prompt if a new one should be created.
+
If a task is defined but the current branch is not in the form
`Txxx-description`, it will prompt if a new branch must be created using current
branch's name prefixed with `Txxx-`.
*log*::
Prints all commits in the provided <revision_range>. For each commit it displays
the Differential ID and its current status. See the 'attach' command for details
on how '<revision_range>' is formed.
*fetch*::
Fetch the branch linked to a Maniphest task. With no argument the task will be
defined from the current branch name, if it is in the form `Txxx-description`.
+
This only fetch and print the commit id, it won't create or checkout a branch.
A new branch can then be created using, for example:
git checkout -b my-branch FETCH_HEAD
See also *checkout* command.
*checkout*::
Same as *fetch* but also create a new branch and check it out. If an existing
branch is found for the same task it will prompt to reset that branch to the
newly fetched commit, then checkout is as well.
*browse*::
Open related URIs in a web browser using *xdg-open*.
+
With no argument, if the current branch is in the form `Txxx-description`, opens
that Maniphest task.
+
If objects is in the form 'Dxxx'/'Txxx' it will open the corresponding
Differential/Maniphest. Otherwise it is assumed that object is a commit as
understood by `git rev-parse` and if that commit contains a link to a
Differential it will be open.
*clean*::
For all local and remote references, if they are in the form `Txxx-description`
and the corresponding task has been closed, prompt if that branch should be
removed.
*land*::
Same as `git push` but for each commit that would be pushed, query who approved
its differential and add corresponding 'Reviewed-by:' line. Note that the email
address is guessed by looking the reviewer's fullname into `git shortlog`. If
the fullname cannot be found it will be asked then stored into
`~/.config/git/phab` so it won't be prompted again.
+
For each related tasks, also prompt if it should be closed.
Examples
--------
Attach all commits since origin/master
$ git phab attach
Attach only the top commit
$ git phab attach HEAD
Attach all commits since origin/master, excluding top commit
$ git phab attach origin/master..HEAD^
Attach top 3 patches, link them to a task, and set reviewers
$ git phab attach --reviewers xclaesse,smcv --task T123 HEAD~3..
Push current branch to origin/wip/phab/T123
$ git config phab.remote origin
$ git phab attach --task T123
Fetch a branch associated with the task T123
$ git phab fetch T123
|