diff --git a/tools/tools/git/git-arc.1 b/tools/tools/git/git-arc.1 --- a/tools/tools/git/git-arc.1 +++ b/tools/tools/git/git-arc.1 @@ -48,6 +48,7 @@ .Op Ar commit Ns | Ns Ar commit-range .Nm .Cm update +.Op Fl m Ar message .Op Ar commit Ns | Ns Ar commit-range .Sh DESCRIPTION The @@ -105,6 +106,15 @@ specified commits. Currently only the diff is updated; the review description and other metadata are not synchronized. +If a message is specified with +.Fl m , +that message is added as a note to the Differential Revision. +If no message is supplied, +the user's editor will be opened to provide an update message for +each revision. +If an empty message is supplied via +.Fl m , +then no notes will be added when updating Differential Revisions. .El .Sh CONFIGURATION These are manipulated by diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh --- a/tools/tools/git/git-arc.sh +++ b/tools/tools/git/git-arc.sh @@ -53,7 +53,7 @@ list | patch [ ...] stage [-b branch] [|] - update [|] + update [-m message] [|] Description: Create or manage FreeBSD Phabricator reviews based on git commits. There @@ -501,7 +501,20 @@ gitarc__update() { - local commit commits diff + local commit commits diff have_msg msg + + while getopts m: o; do + case "$o" in + m) + msg="$OPTARG" + have_msg=1 + ;; + *) + err_usage + ;; + esac + done + shift $((OPTIND-1)) commits=$(build_commit_list "$@") for commit in ${commits}; do @@ -514,8 +527,14 @@ # 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 "$commit" "${commit}~" + if [ -n "$have_msg" ]; then + arc diff --message "$msg" --allow-untracked \ + --never-apply-patches --update "$diff" --head "$commit" \ + "${commit}~" + else + arc diff --allow-untracked --never-apply-patches \ + --update "$diff" --head "$commit" "${commit}~" + fi done }