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

[PATCH 1/5 v2] t/test-lib-functions.sh: allow to specify the tag name to test_commit

From
Brandon Casey <drafnel@gmail.com>
Date
Nov 15, 2012, 05:49 UTC
Message-ID
<1352958570-18724-1-git-send-email-drafnel@gmail.com>
In-Reply-To
<20121115032005.GA20677@ftbfs.org>

The <message> part of test_commit() may not be appropriate for a tag name. So let's allow test_commit to accept a fourth argument to specify the tag name.

Signed-off-by: Brandon Casey <bcasey@nvidia.com>
---
 t/test-lib-functions.sh | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 8889ba5..9e2b8b8 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -135,12 +135,13 @@ test_pause () {
 	fi
 }
 
-# Call test_commit with the arguments "<message> [<file> [<contents>]]"
+# Call test_commit with the arguments "<message> [<file> [<contents> [<tag>]]]"
 #
 # This will commit a file with the given contents and the given commit
-# message.  It will also add a tag with <message> as name.
+# message.  It will also add a tag with <message> as name unless <tag> is
+# given.
 #
-# Both <file> and <contents> default to <message>.
+# <file>, <contents>, and <tag> all default to <message>.
 
 test_commit () {
 	notick= &&
@@ -168,7 +169,7 @@ test_commit () {
 		test_tick
 	fi &&
 	git commit $signoff -m "$1" &&
-	git tag "$1"
+	git tag "${4:-$1}"
 }
 
 # Call test_merge with the arguments "<message> <commit>", where <commit>
-- 
1.8.0
Previous: Brandon Casey
Message 14 of 14 in “t/test-lib-functions.sh: allow to specify the tag name to test_commit”
  1. 1/5 t/test-lib-functions.sh: allow to specify the tag name to test_commitBrandon Casey, Nov 15, 2012
  2. 2/5 t/t3511: demonstrate breakage in cherry-pick -sBrandon Casey, Nov 15, 2012
  3. Junio C HamanoNov 16, 2012
  4. Brandon CaseyNov 16, 2012
  5. 3/5 sequencer.c: handle rfc2822 continuation lines correctlyBrandon Casey, Nov 15, 2012
  6. 4/5 sequencer.c: recognize "(cherry picked from ..." as part of s-o-b footerBrandon Casey, Nov 15, 2012
  7. 4/5 sequencer.c: recognize "(cherry picked from ..." as part of s-o-b footerBrandon Casey, Nov 15, 2012
  8. 5/5 sequencer.c: always separate "(cherry picked from" from commit bodyBrandon Casey, Nov 15, 2012
  9. 6/5 sequencer.c: refrain from adding duplicate s-o-b linesBrandon Casey, Nov 15, 2012
  10. Junio C HamanoNov 16, 2012
  11. Brandon CaseyNov 16, 2012
  12. Matt KraaiNov 15, 2012
  13. Brandon CaseyNov 15, 2012
  14. 1/5 t/test-lib-functions.sh: allow to specify the tag name to test_commitBrandon Casey, Nov 15, 2012

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.