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

[RFC PATCH 1/4] t4013: add expected failure for "log --patch --no-patch"

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 9, 2023, 00:44 UTC
Message-ID
<20230509004406.1786033-2-felipe.contreras@gmail.com>
In-Reply-To
<20230509004406.1786033-1-felipe.contreras@gmail.com>
From: Sergey Organov <sorganov@gmail.com>

--patch followed by --no-patch is to be a no-op according to the "git log" manual page. In reality this sequence breaks --raw output though (and who knows what else?)

Add a test_expected_failure case for the issue.
Signed-off-by: Sergey Organov <sorganov@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 t/t4013-diff-various.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index 5de1d19075..f876b0cc8e 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -457,6 +457,17 @@ diff-tree --stat --compact-summary initial mode
 diff-tree -R --stat --compact-summary initial mode
 EOF
 
+# This should succeed as --patch followed by --no-patch sequence is to
+# be a no-op according to the manual page. In reality it breaks --raw
+# though. Needs to be fixed.
+test_expect_failure '--no-patch cancels --patch only' '
+	git log --raw master >result &&
+	process_diffs result >expected &&
+	git log --patch --no-patch --raw >result &&
+	process_diffs result >actual &&
+	test_cmp expected actual
+'
+
 test_expect_success 'log -m matches pure log' '
 	git log master >result &&
 	process_diffs result >expected &&
-- 
2.40.0+fc1
Previous: Felipe ContrerasNext: Felipe Contreras
Message 2 of 5 in “diff: fix default/no-output”
  1. 0/4 diff: fix default/no-outputFelipe Contreras, May 9, 2023
  2. 1/4 t4013: add expected failure for "log --patch --no-patch"Felipe Contreras, May 9, 2023
  3. 2/4 line-log: set patch format explicitly by defaultFelipe Contreras, May 9, 2023
  4. 3/4 diff: introduce DIFF_FORMAT_DEFAULTFelipe Contreras, May 9, 2023
  5. 4/4 diff: remove DIFF_FORMAT_NO_OUTPUTFelipe Contreras, May 9, 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.