git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] t7004: test that "git-tag -u" implies "-s"

From
Jeff King <peff@peff.net>
Date
Dec 11, 2007, 04:24 UTC
Message-ID
<20071211042436.GA23805@coredump.intra.peff.net>
In-Reply-To
<alpine.LFD.0.9999.0712101950110.28293@woody.linux-foundation.org>

This was lost in the C conversion, but recently fixed by Linus.

Signed-off-by: Jeff King <peff@peff.net>
---
On Mon, Dec 10, 2007 at 08:08:06PM -0800, Linus Torvalds wrote:
Show 7 quoted lines
> It used to be that passing the signing ID with the -u parameter also 
> (obviously!) implied that you wanted to sign and annotate the tag, but 
> that logic got dropped. It also totally ignored the actual key ID that was 
> passed in.
> [...]
> This has gotten only very minimal testing. Somebody should double-check it 
> all, and adding a test would probably be great too.

Looks good to me, and here's a test. It was trivial to whip up, since I wrote a test for almost the identical bug a few days ago (that one was "-s implies -a").

 t/t7004-tag.sh |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index c7130c4..5393d35 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -682,6 +682,14 @@ test_expect_success '-s implies annotated tag' '
 	get_tag_msg implied-annotate >actual &&
 	git diff expect actual
 '
+get_tag_header implied-sign $commit commit $time >expect
+./fakeeditor >>expect
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success '-u implies signed tag' '
+	GIT_EDITOR=./fakeeditor git-tag -u CDDE430D implied-sign &&
+	get_tag_msg implied-sign >actual &&
+	git diff expect actual
+'
 
 test_expect_success \
 	'trying to create a signed tag with non-existing -F file should fail' '
-- 
1.5.3.7.2229.gd040e-dirty
Previous: Linus TorvaldsNext: Junio C Hamano
Message 2 of 4 in “"git tag -u keyname" broken”
  1. Linus TorvaldsDec 11, 2007
  2. t7004: test that "git-tag -u" implies "-s"Jeff King, Dec 11, 2007
  3. Junio C HamanoDec 11, 2007
  4. Jeff KingDec 11, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.