git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] t4205: correctly test %(describe:abbrev=...)
@ 2023-06-28 18:16 Kousik Sanagavarapu
  2023-06-28 21:30 ` Junio C Hamano
  2023-06-29 13:18 ` [PATCH v2] " Kousik Sanagavarapu
  0 siblings, 2 replies; 4+ messages in thread
From: Kousik Sanagavarapu @ 2023-06-28 18:16 UTC (permalink / raw)
  To: git; +Cc: Eli Schwartz, Kousik Sanagavarapu, Christian Couder, Hariom Verma

The pretty format %(describe:abbrev=<number>) tells describe to use only
<number> characters of the oid to generate the human-readable format of
the commit-ish.

This is not apparent in the test for %(describe:abbrev=...) because we
directly tag HEAD and use that, in which case the human-readable format
is just the tag name. So, create a new commit and use that instead.

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Hariom Verma <hariom18599@gmail.com>
Signed-off-by: Kousik Sanagavarapu <five231003@gmail.com>
---
 t/t4205-log-pretty-formats.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh
index 4cf8a77667..b631b5a142 100755
--- a/t/t4205-log-pretty-formats.sh
+++ b/t/t4205-log-pretty-formats.sh
@@ -1011,8 +1011,7 @@ test_expect_success '%(describe:tags) vs git describe --tags' '
 '
 
 test_expect_success '%(describe:abbrev=...) vs git describe --abbrev=...' '
-	test_when_finished "git tag -d tagname" &&
-	git tag -a -m tagged tagname &&
+	test_commit --no-tag file &&
 	git describe --abbrev=15 >expect &&
 	git log -1 --format="%(describe:abbrev=15)" >actual &&
 	test_cmp expect actual
-- 
2.41.0.29.g8148156d44.dirty


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-29 13:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-28 18:16 [PATCH] t4205: correctly test %(describe:abbrev=...) Kousik Sanagavarapu
2023-06-28 21:30 ` Junio C Hamano
2023-06-29  9:12   ` Kousik Sanagavarapu
2023-06-29 13:18 ` [PATCH v2] " Kousik Sanagavarapu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).