> I worked up the patch to do that (see below), but I got stumped trying > to write the commit message. Perhaps that is what the test intended, but > I don't think tag's --format understands "%G" codes at all. So you > cannot tell from the output if a tag was valid or not; you have to check > the exit code separately. > > And if you do something like: > > git tag -v --format='%(tag)' foo bar | > while read tag > do > ... > done > > you cannot tell at all which ones are bogus. Whereas with the current > behavior, the bogus ones are quietly omitted. Which can also be > confusing, but I'd think would generally err on the side of caution. In that case, something like this would be closer to the desired behavior? I'm also unsure on what would be the right thing to put on the commit message. -Santiago. --- diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index b4698ab5f..70f6d4646 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -896,19 +896,18 @@ test_expect_success GPG 'verifying a forged tag should fail' ' ' test_expect_success 'verifying a proper tag with --format pass and format accordingly' ' - cat >expect <<-\EOF + cat >expect <<-\EOF && tagname : signed-tag - EOF && + EOF git tag -v --format="tagname : %(tag)" "signed-tag" >actual && test_cmp expect actual ' -test_expect_success 'verifying a forged tag with --format fail and format accordingly' ' - cat >expect <<-\EOF +test_expect_success 'verifying a forged tag with --format should fail silently' ' + cat >expect <<-\EOF && tagname : forged-tag - EOF && - test_must_fail git tag -v --format="tagname : %(tag)" "forged-tag" >actual && - test_cmp expect actual + EOF + test_must_fail git tag -v --format="tagname : %(tag)" "forged-tag" ' # blank and empty messages for signed tags: diff --git a/t/t7030-verify-tag.sh b/t/t7030-verify-tag.sh index d62ccbb98..ba0aafa1f 100755 --- a/t/t7030-verify-tag.sh +++ b/t/t7030-verify-tag.sh @@ -126,19 +126,18 @@ test_expect_success GPG 'verify multiple tags' ' ' test_expect_success 'verifying tag with --format' ' - cat >expect <<-\EOF + cat >expect <<-\EOF && tagname : fourth-signed - EOF && + EOF git verify-tag --format="tagname : %(tag)" "fourth-signed" >actual && test_cmp expect actual ' -test_expect_success 'verifying a forged tag with --format fail and format accordingly' ' - cat >expect <<-\EOF +test_expect_success 'verifying a forged tag with --format should fail silently' ' + cat >expect <<-\EOF && tagname : 7th forged-signed - EOF && - test_must_fail git verify-tag --format="tagname : %(tag)" $(cat forged1.tag) >actual-forged && - test_cmp expect actual-forged + EOF + test_must_fail git verify-tag --format="tagname : %(tag)" $(cat forged1.tag) ' test_done