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

Re: [PATCH v4 0/4] Introduce diff.submodule

From
Jeff King <peff@peff.net>
Date
Nov 15, 2012, 16:33 UTC
Message-ID
<20121115163356.GF6157@sigill.intra.peff.net>
In-Reply-To
<20121115162524.GE6157@sigill.intra.peff.net>
On Thu, Nov 15, 2012 at 08:25:26AM -0800, Jeff King wrote:
Show 5 quoted lines
> > Thanks, this version looks good to me.
> 
> Oh wait. I did not look closely enough. The point was to move the option
> parser _out_ of git_diff_ui_config into git_diff_basic_config, so that
> it only triggers for porcelain, not plumbing.

Oh no, I am having a muddled morning. It _is_ right. We want to move it out of basic into ui. Sorry for the noise. I just woke up and am thinking backwards.

It may be worth squashing this test into patch 3:
diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh
index e401814..023439f 100755
--- a/t/t4041-diff-submodule-option.sh
+++ b/t/t4041-diff-submodule-option.sh
@@ -72,6 +72,21 @@ EOF
 	test_cmp expected actual
 "
 
+test_expect_success 'diff.submodule does not affect plumbing' '
+	test_config diff.submodule log &&
+	git diff-index -p HEAD >actual &&
+	cat >expected <<-EOF &&
+	diff --git a/sm1 b/sm1
+	new file mode 160000
+	index 0000000..a2c4dab
+	--- /dev/null
+	+++ b/sm1
+	@@ -0,0 +1 @@
+	+Subproject commit $fullhead1
+	EOF
+	test_cmp expected actual
+'
+
 commit_file sm1 &&
 head2=$(add_file sm1 foo3)
 

BTW, while writing the test, I noticed two minor nits with your tests:

  1. They can use test_config, which is simpler (you do not need to
     unset yourself after the test) and safer (the unset happens via
     test_when_finished, so it works even if the test fails).

  2. You can still indent expected output when using <<-.

I don't know if it is worth re-rolling for them.

-Peff
Previous: Jeff KingNext: Ramkumar Ramachandra
Message 11 of 12 in “Introduce diff.submodule”
  1. 0/4 Introduce diff.submoduleRamkumar Ramachandra, Nov 13, 2012
  2. 1/4 Documentation: move diff.wordRegex from config.txt to diff-config.txtRamkumar Ramachandra, Nov 13, 2012
  3. 2/4 diff: introduce diff.submodule configuration variableRamkumar Ramachandra, Nov 13, 2012
  4. Junio C HamanoNov 20, 2012
  5. Ramkumar RamachandraNov 22, 2012
  6. Ramkumar RamachandraNov 22, 2012
  7. 3/4 diff: rename "set" variableRamkumar Ramachandra, Nov 13, 2012
  8. 4/4 submodule: display summary header in boldRamkumar Ramachandra, Nov 13, 2012
  9. Jeff KingNov 15, 2012
  10. Jeff KingNov 15, 2012
  11. Jeff KingNov 15, 2012
  12. Ramkumar RamachandraNov 16, 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.