Page MenuHomeFreeBSD

D59019.id184580.diff
No OneTemporary

D59019.id184580.diff

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
@@ -24,7 +24,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd August 11, 2026
+.Dd August 19, 2026
.Dt GIT-ARC 1
.Os
.Sh NAME
@@ -33,9 +33,10 @@
.Sh SYNOPSIS
.Nm
.Cm create
-.Op Fl dl
+.Op Fl dhl
.Op Fl r Ar reviewer1 Ns Op Cm \&, Ns Ar reviewer2 ...
.Op Fl s Ar subscriber1 Ns Op Cm \&, Ns Ar subscriber2 ...
+.Op Fl t Ar tag1 Ns Op Cm \&, Ns Ar tag2 ...
.Op Fl p Ar parent
.Ar commit-ref Op Ar commit-ref ...
.Nm
@@ -103,6 +104,8 @@
until the review is published via the web UI.
The draft is still visible to anyone with the URL (or able to guess it),
but the review's visibility settings can be modified before publishing.
+.It Fl h
+Print usage statement and exit.
.It Fl l
Before processing commit(s) display list of commits to be processed
and wait for confirmation.
@@ -114,6 +117,14 @@
.It Fl s Ar subscriber
Add one or more subscribers, separated by commas, to revision(s) being created.
Each argument must be an existing Phabricator user or group.
+.It Fl t Ar tag
+Add one or more project tags, separated by commas, to revision(s) being created.
+Each argument must be an existing Phabricator project tag.
+Unlike group reviewers, a leading
+.Ql #
+is optional and is added if omitted.
+Spaces in tag names should be replaced with underscores
+.Pq e.g., Src_committers for the Do Src Committers Dc tag .
.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 an already existing
@@ -263,6 +274,15 @@
.Dq Jails
reviewer group is added using its hashtag.
.Pp
+Create a review and assign project tags so it appears in the
+corresponding Differential queries.
+Spaces in tag names are written as underscores; a leading
+.Ql #
+is optional:
+.Bd -literal -offset indent
+$ git arc create -t linuxkpi,Src_committers HEAD
+.Ed
+.Pp
Create a series of Phabricator reviews for each of HEAD~2, HEAD~ and
HEAD:
.Bd -literal -offset indent
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
@@ -234,10 +234,40 @@
echo "$diff"
}
+#
+# Convert a comma-separated tag list into Phabricator project hashtags.
+# Spaces become underscores; a leading '#' is added if missing.
+#
+tags2hashtags()
+{
+ local out rest tag
+
+ out=
+ rest=$1,
+ while [ -n "$rest" ]; do
+ tag=${rest%%,*}
+ rest=${rest#*,}
+ tag=$(printf '%s\n' "$tag" |
+ sed -e 's/^[[:space:]]*//' \
+ -e 's/[[:space:]]*$//' \
+ -e 's/[[:space:]]\{1,\}/_/g')
+ [ -n "$tag" ] || continue
+ case "$tag" in
+ \#*)
+ ;;
+ *)
+ tag="#$tag"
+ ;;
+ esac
+ out="$out, $tag"
+ done
+ printf '%s\n' "${out#, }"
+}
+
create_one_review()
{
local childphid commit doprompt draft msg parent parentphid reviewers
- local subscribers
+ local subscribers tags
commit=$1
reviewers=$2
@@ -245,6 +275,7 @@
parent=$4
doprompt=$5
draft=$6
+ tags=$7
if [ "$doprompt" ] && ! show_and_prompt "$commit"; then
return 1
@@ -263,6 +294,10 @@
printf "%s\n" "${reviewers}" >> "$msg"
printf "\nSubscribers:\n" >> "$msg"
printf "%s\n" "${subscribers}" >> "$msg"
+ if [ -n "$tags" ]; then
+ printf "\nTags:\n" >> "$msg"
+ printf "%s\n" "${tags}" >> "$msg"
+ fi
yes | EDITOR=true \
arc diff --message-file "$msg" --never-apply-patches --create \
@@ -377,6 +412,7 @@
gitarc__create()
{
local commit commits doprompt draft list o prev reviewers subscribers
+ local tags
list=
prev=""
@@ -385,7 +421,7 @@
fi
doprompt=1
draft=0
- while getopts dlp:r:s: o; do
+ while getopts dlp:r:s:t: o; do
case "$o" in
d)
draft=1
@@ -402,6 +438,9 @@
s)
subscribers="$OPTARG"
;;
+ t)
+ tags=$(tags2hashtags "$OPTARG")
+ ;;
*)
err_usage
;;
@@ -423,7 +462,7 @@
for commit in ${commits}; do
if create_one_review "$commit" "$reviewers" "$subscribers" "$prev" \
- "$doprompt" "$draft"; then
+ "$doprompt" "$draft" "$tags"; then
prev=$(commit2diff "$commit")
else
prev=""

File Metadata

Mime Type
text/plain
Expires
Wed, Aug 26, 2:05 AM (16 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37262606
Default Alt Text
D59019.id184580.diff (4 KB)

Event Timeline