aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2021-03-03 22:00:58 +0000
committerMark Johnston <markj@FreeBSD.org>2021-03-03 22:00:58 +0000
commitc49b075305a7aa1c7f500db1672cd1d2b8066b55 (patch)
treed7b959da32ea9e7eedf9af9ece4e4bcb95adad12
parentafc3e54eeee635a525c88e4678cc38e3219302c3 (diff)
downloadsrc-c49b075305a7aa1c7f500db1672cd1d2b8066b55.tar.gz
src-c49b075305a7aa1c7f500db1672cd1d2b8066b55.zip
git-arc: Handle commit ranges in the "update" verb
Reported by: imp
-rw-r--r--tools/tools/git/git-arc.sh28
1 files changed, 14 insertions, 14 deletions
diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh
index 07b042ceb151..c3541e438c9f 100644
--- a/tools/tools/git/git-arc.sh
+++ b/tools/tools/git/git-arc.sh
@@ -53,7 +53,7 @@ Commands:
list <commit>|<commit range>
patch <diff1> [<diff2> ...]
stage [-b branch] [<commit>|<commit range>]
- update <commit>
+ update [<commit>|<commit range>]
Description:
Create or manage FreeBSD Phabricator reviews based on git commits. There
@@ -500,24 +500,24 @@ gitarc::stage()
gitarc::update()
{
- local commit diff
-
- commit=$1
- diff=$(commit2diff $commit)
-
- if ! show_and_prompt $commit; then
- return
- fi
+ local commit commits diff
+ commits=$(build_commit_list $@)
save_head
+ for commit in ${commits}; do
+ diff=$(commit2diff $commit)
- git checkout -q $commit
+ if ! show_and_prompt $commit; then
+ break
+ fi
- # The linter is stupid and applies patches to the working copy.
- # This would be tolerable if it didn't try to correct "misspelled" variable
- # names.
- arc diff --allow-untracked --never-apply-patches --update $diff HEAD~
+ git checkout -q $commit
+ # The linter is stupid and applies patches to the working copy.
+ # This would be tolerable if it didn't try to correct "misspelled" variable
+ # names.
+ arc diff --allow-untracked --never-apply-patches --update $diff HEAD~
+ done
restore_head
}