* [PATCH] "git-tag -s" should create a signed annotated tag
@ 2007-11-25 23:21 Junio C Hamano
2007-11-26 4:50 ` Jeff King
2007-11-26 4:51 ` Carlos Rica
0 siblings, 2 replies; 3+ messages in thread
From: Junio C Hamano @ 2007-11-25 23:21 UTC (permalink / raw)
To: git; +Cc: Carlos Rica
The earlier patch 396865859918e9c7bf8ce74aae137c57da134610 (Make
builtin-tag.c use parse_options.) broke "git-tag -s".
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
* It's _very_ disturbing that the testsuite did not catch this
breakage, even though I though we had a very detailed coverage for
"git tag" when it was rewritten in C.
builtin-tag.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/builtin-tag.c b/builtin-tag.c
index 3a6467d..114c684 100644
--- a/builtin-tag.c
+++ b/builtin-tag.c
@@ -398,6 +398,9 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
argc = parse_options(argc, argv, options, git_tag_usage, 0);
+ if (sign)
+ annotate = 1;
+
if (list)
return list_tags(list == no_pattern ? NULL : list, lines);
if (delete)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] "git-tag -s" should create a signed annotated tag
2007-11-25 23:21 [PATCH] "git-tag -s" should create a signed annotated tag Junio C Hamano
@ 2007-11-26 4:50 ` Jeff King
2007-11-26 4:51 ` Carlos Rica
1 sibling, 0 replies; 3+ messages in thread
From: Jeff King @ 2007-11-26 4:50 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Carlos Rica
On Sun, Nov 25, 2007 at 03:21:42PM -0800, Junio C Hamano wrote:
> * It's _very_ disturbing that the testsuite did not catch this
> breakage, even though I though we had a very detailed coverage for
> "git tag" when it was rewritten in C.
Then where is the new test to accompany your patch? :P
-- >8 --
git-tag: test that -s implies an annotated tag
This detects a regression introduced while moving git-tag to a C
builtin.
Signed-off-by: Jeff King <peff@peff.net>
---
t/t7004-tag.sh | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 736f22e..c7130c4 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -667,6 +667,22 @@ test_expect_success 'creating a signed tag with -F - should succeed' '
git diff expect actual
'
+cat >fakeeditor <<'EOF'
+#!/bin/sh
+test -n "$1" && exec >"$1"
+echo A signed tag message
+echo from a fake editor.
+EOF
+chmod +x fakeeditor
+get_tag_header implied-annotate $commit commit $time >expect
+./fakeeditor >>expect
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success '-s implies annotated tag' '
+ GIT_EDITOR=./fakeeditor git-tag -s implied-annotate &&
+ get_tag_msg implied-annotate >actual &&
+ git diff expect actual
+'
+
test_expect_success \
'trying to create a signed tag with non-existing -F file should fail' '
! test -f nonexistingfile &&
--
1.5.3.6.2022.gd7807a-dirty
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] "git-tag -s" should create a signed annotated tag
2007-11-25 23:21 [PATCH] "git-tag -s" should create a signed annotated tag Junio C Hamano
2007-11-26 4:50 ` Jeff King
@ 2007-11-26 4:51 ` Carlos Rica
1 sibling, 0 replies; 3+ messages in thread
From: Carlos Rica @ 2007-11-26 4:51 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On Nov 26, 2007 12:21 AM, Junio C Hamano <gitster@pobox.com> wrote:
> The earlier patch 396865859918e9c7bf8ce74aae137c57da134610 (Make
> builtin-tag.c use parse_options.) broke "git-tag -s".
>
> * It's _very_ disturbing that the testsuite did not catch this
> breakage, even though I though we had a very detailed coverage for
> "git tag" when it was rewritten in C.
Yes, you're right, "-s" without -m or -F is creating lightweight tags
in my proposal.
I think it is due to the absence of tests checking the "editor" option, that is,
calls without -m or -F options to provide the message, since the tests are using
only those and they are enabling automatically the creation of annotated tags.
I need to think in adding tests replacing the editor with a custom command
to check also the correct behaviour of git-tag when the EDITOR and/or
the other variables are set.
At the end, I've learned that it's better to test a little of every feature than
test completely only a few of them.
Thank you.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-11-26 4:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-25 23:21 [PATCH] "git-tag -s" should create a signed annotated tag Junio C Hamano
2007-11-26 4:50 ` Jeff King
2007-11-26 4:51 ` Carlos Rica
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).