aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2024-02-06 21:16:51 +0000
committerWarner Losh <imp@FreeBSD.org>2024-02-06 21:16:51 +0000
commite1735b35e3e4a61f2552fb0a551973066f2bde34 (patch)
tree81aa1eb1bf889850b8ec88067edcbecfac83931c /tools
parent12bae251fbfa33f375d134e0840d88c4363b8b94 (diff)
downloadsrc-e1735b35e3e4a61f2552fb0a551973066f2bde34.tar.gz
src-e1735b35e3e4a61f2552fb0a551973066f2bde34.zip
git-arc: Retain color status messages
Newer versions of archanist have an --ansi option to always include the ansi colors when doing an arc list (or any command really). Add this to the arc list that's relevant. Add filter to filter out the 'bolding' though since that interferes with our parsing. This should restore the color output after df834e06bbc7. Fixes: df834e06bbc7 Sponsored by: Netflix Reviewed by: markj, jhb Differential Revision: https://reviews.freebsd.org/D43459
Diffstat (limited to 'tools')
-rw-r--r--tools/tools/git/git-arc.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh
index 316e160abeed..c74577e2d5d7 100644
--- a/tools/tools/git/git-arc.sh
+++ b/tools/tools/git/git-arc.sh
@@ -159,12 +159,12 @@ arc_call_conduit()
}
#
-# Filter the output of arc list to remove the warnings as above, as well as any
-# stray escape sequences that are in the list (it interferes with the parsing)
+# Filter the output of arc list to remove the warnings as above, as well as
+# the bolding sequence (the color sequence remains intact).
#
arc_list()
{
- arc list "$@" | sed 's/\x1b\[[0-9;]*m//g' | grep -v '^Warning: '
+ arc list "$@" | grep -v '^Warning: ' | sed -E 's/\x1b\[1m//g;s/\x1b\[m//g'
}
diff2phid()
@@ -219,7 +219,7 @@ title2diff()
local title
title=$(echo $1 | sed 's/"/\\"/g')
- arc_list |
+ arc_list --no-ansi |
awk -F': ' '{
if (substr($0, index($0, FS) + length(FS)) == "'"$title"'") {
print substr($1, match($1, "D[1-9][0-9]*"))
@@ -430,7 +430,7 @@ gitarc__list()
local chash commit commits diff openrevs title
commits=$(build_commit_list "$@")
- openrevs=$(arc_list)
+ openrevs=$(arc_list --ansi)
for commit in $commits; do
chash=$(git show -s --format='%C(auto)%h' "$commit")
@@ -449,7 +449,7 @@ gitarc__list()
awk -F'D[1-9][0-9]*: ' \
'{if ($2 == "'"$(echo $title | sed 's/"/\\"/g')"'") print $0}')
if [ -z "$diff" ]; then
- echo "No Review : $title"
+ echo "No Review : $title"
elif [ "$(echo "$diff" | wc -l)" -ne 1 ]; then
echo -n "Ambiguous Reviews: "
echo "$diff" | grep -E -o 'D[1-9][0-9]*:' | tr -d ':' \