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

Re: [PATCH] ref-filter: initialize empty name or email fields

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 21, 2019, 21:57 UTC
Message-ID
<xmqq1rxerxkk.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<xmqqimqtxcou.fsf@gitster-ct.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 6 quoted lines
> Mischa POSLAWSKY <git@shiar.nl> writes:
>
>> If I understand correctly, such tags cannot be produced normally anymore.
>> Therefore I'm unsure how to make tests, and if that is even warranted.
>
> Thanks for spotting.
A quick trial to recreate a tag object seems to succeed:
    $ git cat-file tag v0.99 |
    > sed -e '/-----BEGIN/,$d' |
    > git hash-object --stdin -w -t tag
    667d141b478eee5e53d2ee05acd61bb1f640249a
    $ git cat-file tag 667d141b47
    object a3eb250f996bf5e12376ec88622c4ccaabf20ea8
    type commit
    tag v0.99
    Test-release for wider distribution.
    I'll make the first public RPM's etc, thus the tag.

So we should be able to do something along the above line. Here is my quick-n-dirty one.

 t/t6300-for-each-ref.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index ab69aa176d..b3a6b336fa 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -869,4 +869,16 @@ test_expect_success 'for-each-ref --ignore-case ignores case' '
 	test_cmp expect actual
 '
 
+test_expect_success 'show a taggerless tag' '
+	test_commit tagged &&
+	git tag -a -m "a normal tag" to-be-shown-0 HEAD &&
+	another=$(git cat-file tag to-be-shown-0 |
+		sed -e "/^tagger /d" \
+		    -e "/^tag to-be-shown/s/0/1/" \
+		    -e "s/a normal tag/a broken tag/" |
+		git hash-object --stdin -w -t tag) &&
+	git tag to-be-shown-1 $another &&
+	git for-each-ref --format="%(refname:short) %(taggername)" refs/tags/to-be-shown\*
+'
+
 test_done
Previous: Mischa POSLAWSKYNext: Mischa POSLAWSKY
Message 5 of 9 in “ref-filter: initialize empty name or email fields”
  1. ref-filter: initialize empty name or email fieldsMischa POSLAWSKY, Aug 17, 2019
  2. Junio C HamanoAug 19, 2019
  3. Junio C HamanoAug 20, 2019
  4. Mischa POSLAWSKYAug 22, 2019
  5. Junio C HamanoAug 21, 2019
  6. 2/1 t6300: format missing taggerMischa POSLAWSKY, Aug 22, 2019
  7. Junio C HamanoAug 22, 2019
  8. Mischa POSLAWSKYAug 22, 2019
  9. Junio C HamanoAug 22, 2019

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.