aboutsummaryrefslogtreecommitdiff
path: root/tools/tools/git
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2021-11-19 02:49:20 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2021-11-19 02:49:20 +0000
commit964035c409b1b7229c7bc0220e7455e4a038ed4b (patch)
tree817ce4b80ab529eba710a5e0a1f6cecce9408116 /tools/tools/git
parent760be44702ba7748589de69f6e82c97a5d2eb5bc (diff)
downloadsrc-964035c409b1b7229c7bc0220e7455e4a038ed4b.tar.gz
src-964035c409b1b7229c7bc0220e7455e4a038ed4b.zip
git-arc: with "create" allow to specify parent of the first commit
Reviewed by: markj Differential revision: https://reviews.freebsd.org/D33045
Diffstat (limited to 'tools/tools/git')
-rw-r--r--tools/tools/git/git-arc.17
-rw-r--r--tools/tools/git/git-arc.sh7
2 files changed, 11 insertions, 3 deletions
diff --git a/tools/tools/git/git-arc.1 b/tools/tools/git/git-arc.1
index b59f3eea17ca..984b1e8f32e5 100644
--- a/tools/tools/git/git-arc.1
+++ b/tools/tools/git/git-arc.1
@@ -24,7 +24,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd May 14, 2021
+.Dd November 17, 2021
.Dt GIT-ARC 1
.Os
.Sh NAME
@@ -36,6 +36,7 @@
.Op Fl l
.Op Fl r Ar reviewer1 Ns Op Cm \&, Ns Ar reviewer2 ...
.Op Fl s Ar subscriber1 Ns Op Cm \&, Ns Ar subscriber2 ...
+.Op Fl p Ar parent
.Op Ar commit Ns | Ns Ar commit-range
.Nm
.Cm list Ar commit Ns | Ns Ar commit-range
@@ -78,6 +79,10 @@ Argument(s) must be existing Phabricator user or group.
.It Fl r Ar subscriber
Add one or more subscribers, separated by commas, to revision(s) being created.
Argument(s) must be existing Phabricator user or group.
+.It Fl p Ar parent
+Specify the parent of the first commit in the list.
+This is useful when adding more commits on top of the already existing
+stack in Phabricator.
.El
.It Cm list
Print the associated Differential Revisions for the specified commits.
diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh
index 0c288e7ac6e2..35a815ece137 100644
--- a/tools/tools/git/git-arc.sh
+++ b/tools/tools/git/git-arc.sh
@@ -356,15 +356,19 @@ gitarc__create()
local commit commits doprompt list o prev reviewers subscribers
list=
+ prev=""
if [ "$(git config --bool --get arc.list 2>/dev/null || echo false)" != "false" ]; then
list=1
fi
doprompt=1
- while getopts lr:s: o; do
+ while getopts lp:r:s: o; do
case "$o" in
l)
list=1
;;
+ p)
+ prev="$OPTARG"
+ ;;
r)
reviewers="$OPTARG"
;;
@@ -391,7 +395,6 @@ gitarc__create()
fi
save_head
- prev=""
for commit in ${commits}; do
if create_one_review "$commit" "$reviewers" "$subscribers" "$prev" \
"$doprompt"; then