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

[PATCH] add a test for "describe --contains" with mixed tags

From
orgads@gmail.com <orgads@gmail.com>
Date
Oct 24, 2017, 17:02 UTC
Message-ID
<20171024170242.31894-1-orgads@gmail.com>
From: Orgad Shaneh <orgads@gmail.com>

If a repository has early lightweight tags and annotated tags later, running git describe --contains for an early commit used the annotated tag for reference, instead of the lightweight tag which was closer.

This has been fixed in ef1e74065c19cc427c4a1b322154fd55d7a3588b, and regression was tweaked in 5554451de61cb90e530f30b96e62d455e1eff6a1.

Add a test for that to avoid further regressions.
Signed-off-by: Orgad Shaneh <orgads@gmail.com>
---
 t/t6120-describe.sh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index 1c0e8659d..08427f4b5 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -340,4 +340,20 @@ test_expect_success ULIMIT_STACK_SIZE 'describe works in a deep repo' '
 	test_cmp expect actual
 '
 
+test_expect_success 'describe --contains for light before annotated' '
+	test_tick &&
+	git commit --allow-empty -m First &&
+	test_tick &&
+	git commit --allow-empty -m Second &&
+	test_tick &&
+	git commit --allow-empty -m Third &&
+	test_tick &&
+	git tag light-before-annotated HEAD^ &&
+	test_tick &&
+	git tag -a -m annotated annotated-after-light
+
+'
+
+check_describe light-before-annotated~1 --contains light-before-annotated~1
+
 test_done
-- 
2.15.0.rc2
Message 1 of 1 in “add a test for "describe --contains" with mixed tags”
  1. add a test for "describe --contains" with mixed tagsorgads@gmail.com, Oct 24, 2017

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.