Re: [PATCH 04/10] test-lib functions: add an --annotated-tag option to "test_commit"
flat view
From: Junio C Hamano <hidden>
Date: 2021-03-01 21:46:12
Ævar Arnfjörð Bjarmason [off-list ref] writes:
quoted hunk
@@ -220,6 +225,9 @@ test_commit () { --no-tag) no_tag=yes ;; + --annotated-tag) + annotated_tag=yes + ;;
A new option is welcome, but shouldn't we be straightening out the
variables that keep track of the options around tagging? It's not
like it is possible to have 4 (two variables that can independently
set to 'yes') possibilities, so something along the lines of ...
test_commit () {
+ tag=light &&
notick= &&
...
while test $# != 0
do
case "$1" in
...
--no-tag)
- no_tag=yes
+ tag=none
;;
+ --annotated)
+ tag=annotated
+ ;;
...
- if test -z "$no_tag"
- then
+ case "$tag" in
+ none)
+ ;;
+ light)
git ${indir:+ -C "$indir") tag "${4:-$1}"
+ ;;
+ annotated)
+ git ${indir:+ -C "$indir") tag -m "$1" "${4:-$1}"
+ ;;
+ esac
...
after this step (meaning, we may want to start from fixing the no_tag=yes
to tag=none before introducing this new feature).
Thanks.
quoted hunk
@@ -244,7 +252,15 @@ test_commit () { $signoff -m "$1" && if test -z "$no_tag" then - git ${indir:+ -C "$indir"} tag "${4:-$1}" + if test -n "$annotated_tag" + then + if test -z "$notick" + then + test_tick + fi && + test_tick + fi && + git ${indir:+ -C "$indir"} tag ${annotated_tag:+ -a -m "$1"} "${4:-$1}" fi }