{"thread":{"id":"11019","subject":"[PATCH] \"git-tag -s\" should create a signed annotated tag","startedAt":"2007-11-25T23:21:42Z","lastAt":"2007-11-26T04:51:47Z","messageCount":3,"participants":["Junio C Hamano","Jeff King","Carlos Rica"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"60888","messageId":"7vprxxj4hl.fsf@gitster.siamese.dyndns.org","threadId":"11019","inReplyTo":null,"subject":"[PATCH] \"git-tag -s\" should create a signed annotated tag","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-25T23:21:42Z","receivedAt":"2007-11-25T23:21:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The earlier patch 396865859918e9c7bf8ce74aae137c57da134610 (Make\nbuiltin-tag.c use parse_options.) broke \"git-tag -s\".\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * It's _very_ disturbing that the testsuite did not catch this\n   breakage, even though I though we had a very detailed coverage for\n   \"git tag\" when it was rewritten in C.\n\n builtin-tag.c |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-tag.c b/builtin-tag.c\nindex 3a6467d..114c684 100644\n--- a/builtin-tag.c\n+++ b/builtin-tag.c\n@@ -398,6 +398,9 @@ int cmd_tag(int argc, const char **argv, const char *prefix)\n \n \targc = parse_options(argc, argv, options, git_tag_usage, 0);\n \n+\tif (sign)\n+\t\tannotate = 1;\n+\n \tif (list)\n \t\treturn list_tags(list == no_pattern ? NULL : list, lines);\n \tif (delete)\n"},{"id":"60906","messageId":"20071126045058.GB6471@sigill.intra.peff.net","threadId":"11019","inReplyTo":"7vprxxj4hl.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] \"git-tag -s\" should create a signed annotated tag","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-11-26T04:50:58Z","receivedAt":"2007-11-26T04:50:58Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Nov 25, 2007 at 03:21:42PM -0800, Junio C Hamano wrote:\n\n>  * It's _very_ disturbing that the testsuite did not catch this\n>    breakage, even though I though we had a very detailed coverage for\n>    \"git tag\" when it was rewritten in C.\n\nThen where is the new test to accompany your patch? :P\n\n-- >8 --\ngit-tag: test that -s implies an annotated tag\n\nThis detects a regression introduced while moving git-tag to a C\nbuiltin.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n t/t7004-tag.sh |   16 ++++++++++++++++\n 1 files changed, 16 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex 736f22e..c7130c4 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -667,6 +667,22 @@ test_expect_success 'creating a signed tag with -F - should succeed' '\n \tgit diff expect actual\n '\n \n+cat >fakeeditor <<'EOF'\n+#!/bin/sh\n+test -n \"$1\" && exec >\"$1\"\n+echo A signed tag message\n+echo from a fake editor.\n+EOF\n+chmod +x fakeeditor\n+get_tag_header implied-annotate $commit commit $time >expect\n+./fakeeditor >>expect\n+echo '-----BEGIN PGP SIGNATURE-----' >>expect\n+test_expect_success '-s implies annotated tag' '\n+\tGIT_EDITOR=./fakeeditor git-tag -s implied-annotate &&\n+\tget_tag_msg implied-annotate >actual &&\n+\tgit diff expect actual\n+'\n+\n test_expect_success \\\n \t'trying to create a signed tag with non-existing -F file should fail' '\n \t! test -f nonexistingfile &&\n-- \n1.5.3.6.2022.gd7807a-dirty\n"},{"id":"60907","messageId":"1b46aba20711252051x5ec7398er6806f21e179583d4@mail.gmail.com","threadId":"11019","inReplyTo":"7vprxxj4hl.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] \"git-tag -s\" should create a signed annotated tag","fromName":"Carlos Rica","fromEmail":"jasampler@gmail.com","sentAt":"2007-11-26T04:51:47Z","receivedAt":"2007-11-26T04:51:47Z","isPatch":true,"sender":{"key":"jasampler@gmail.com","avatar":null},"body":"On Nov 26, 2007 12:21 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> The earlier patch 396865859918e9c7bf8ce74aae137c57da134610 (Make\n> builtin-tag.c use parse_options.) broke \"git-tag -s\".\n>\n>  * It's _very_ disturbing that the testsuite did not catch this\n>    breakage, even though I though we had a very detailed coverage for\n>    \"git tag\" when it was rewritten in C.\n\nYes, you're right, \"-s\" without -m or -F is creating lightweight tags\nin my proposal.\n\nI think it is due to the absence of tests checking the \"editor\" option, that is,\ncalls without -m or -F options to provide the message, since the tests are using\nonly those and they are enabling automatically the creation of annotated tags.\n\nI need to think in adding tests replacing the editor with a custom command\nto check also the correct behaviour of git-tag when the EDITOR and/or\nthe other variables are set.\n\nAt the end, I've learned that it's better to test a little of every feature than\ntest completely only a few of them.\n\nThank you.\n"}]}