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

[PATCH] t9800: correct misuse of 'show -s --raw' in a test

From
Junio C Hamano <gitster@pobox.com>
Date
May 6, 2023, 21:29 UTC
Message-ID
<xmqqild5rvvw.fsf@gitster.g>

There is $(git show -s --raw --pretty=format:%at HEAD) in this test that is meant to grab the author time of the commit. We used to have a bug in the command line option parser of the diff family of commands, where "show -s --raw" was identical to "show -s".

With the "-s" bug fixed, "show -s --raw" would mean the same thing as "show --raw", i.e. show the output from the diff machinery in the "raw" format. And this test will start failing, so fix it before that happens.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
* It appears pretty obvious that the original wanted to just grab
  the %at timestamp of the HEAD, and with the fix to allow output
  format options to take effect after "-s" is given, the existing
  misuse of "--raw" after "-s" that ought to be a no-op breaks the
  test.
  https://github.com/git/git/actions/runs/4897931294/jobs/8755228452#step:4:1847
  is CI run with the "-s" fix merged into 'seen'.
 t/t9800-git-p4-basic.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t9800-git-p4-basic.sh b/t/t9800-git-p4-basic.sh
index dc88d0e064..a4b3cb9492 100755
--- a/t/t9800-git-p4-basic.sh
+++ b/t/t9800-git-p4-basic.sh
@@ -330,7 +330,7 @@ test_expect_success 'initial import time from top change time' '
 	test_when_finished cleanup_git &&
 	(
 		cd "$git" &&
-		gittime=$(git show -s --raw --pretty=format:%at HEAD) &&
+		gittime=$(git show -s --pretty=format:%at HEAD) &&
 		echo $p4time $gittime &&
 		test $p4time = $gittime
 	)
-- 
2.40.1-476-g69c786637d
Next: Jeff King
Message 1 of 3 in “t9800: correct misuse of 'show -s --raw' in a test”
  1. t9800: correct misuse of 'show -s --raw' in a testJunio C Hamano, May 6, 2023
  2. Jeff KingMay 8, 2023
  3. Junio C HamanoMay 8, 2023

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.