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

[PATCH 2/4] t6120: test name-rev --all and --stdin

From
Michael J Gruber <git@grubix.eu>
Date
Sep 7, 2017, 14:02 UTC
Message-ID
<eb1b76068d898dd5fe1d4549c8985796a083ce18.1504792601.git.git@grubix.eu>
In-Reply-To
<c1cb526d-a567-b598-d980-5dbe695b7d6a@grubix.eu>

name-rev is used in a few tests, but tested only in t6120 along with describe so far.

Add tests for name-rev with --all and --stdin.
Signed-off-by: Michael J Gruber <git@grubix.eu>
---
 t/t6120-describe.sh | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index aa74eb8f0d..7c5728ebd5 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -198,6 +198,31 @@ test_expect_success 'name-rev with exact tags' '
 	test_cmp expect actual
 '
 
+test_expect_success 'name-rev --all' '
+	>expect.unsorted &&
+	for rev in $(git rev-list --all)
+	do
+		git name-rev $rev >>expect.unsorted
+	done &&
+	sort <expect.unsorted >expect &&
+	git name-rev --all >actual.unsorted &&
+	sort <actual.unsorted >actual &&
+	test_cmp expect actual
+'
+
+test_expect_success 'name-rev --stdin' '
+	>expect.unsorted &&
+	for rev in $(git rev-list --all)
+	do
+		name=$(git name-rev --name-only $rev) &&
+		echo "$rev ($name)" >>expect.unsorted
+	done &&
+	sort <expect.unsorted >expect &&
+	git rev-list --all | git name-rev --stdin >actual.unsorted &&
+	sort <actual.unsorted >actual &&
+	test_cmp expect actual
+'
+
 test_expect_success 'describe --contains with the exact tags' '
 	echo "A^0" >expect &&
 	tag_object=$(git rev-parse refs/tags/A) &&
-- 
2.14.1.603.gf58147c36e
Previous: Michael J GruberNext: Michael J Gruber
Message 7 of 14 in “name-rev: change ULONG_MAX to TIME_MAX”
  1. name-rev: change ULONG_MAX to TIME_MAXMichael J Gruber, Aug 30, 2017
  2. Johannes SchindelinAug 30, 2017
  3. Junio C HamanoSep 6, 2017
  4. Michael J GruberSep 6, 2017
  5. Jeff KingSep 6, 2017
  6. Michael J GruberSep 7, 2017
  7. 2/4 t6120: test name-rev --all and --stdinMichael J Gruber, Sep 7, 2017
  8. 4/4 t6120: test describe and name-rev with deep reposMichael J Gruber, Sep 7, 2017
  9. 1/4 t7004: move limited stack prereq to test-libMichael J Gruber, Sep 7, 2017
  10. 3/4 t6120: clean up state after breaking repoMichael J Gruber, Sep 7, 2017
  11. 0/4 Test name-rev with small stackMichael J Gruber, Sep 7, 2017
  12. Jeff KingSep 7, 2017
  13. Michael J GruberSep 8, 2017
  14. Jeff KingSep 11, 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.