Skip to contentSkip to conversation

diff: recurse into nested submodules for inline diff

PATCH RESEND In review Stefan Beller 3 participants 3 messages May 4, 2017 – May 8, 2017

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 diff: recurse into nested submodules for inline diff

When fd47ae6a5b (diff: teach diff to display submodule difference with an inline diff, 2016-08-31) was introduced, we did not think of recursing into nested submodules.

When showing the inline diff for submodules, automatically recurse into nested submodules as well with inline submodule diffs.

---

This is a resend of
https://public-inbox.org/git/[email protected]/

In the cover letter of that patch, I said I would want to redo the tests with scrubbed output. However given the widespread use of unscrubbed output, I think this is fine as-is to include.

Thanks,
Stefan

 submodule.c                                  |  3 +-
 t/t4060-diff-submodule-option-diff-format.sh | 41 ++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+), 1 deletion(-)
submodule.c +2 -1
index d3299e29c0..2d56a9562e 100644
@@ -554,7 +554,8 @@ void show_submodule_inline_diff(FILE *f, const char *path,
 	cp.no_stdin = 1;
 
 	/* TODO: other options may need to be passed here. */
-	argv_array_push(&cp.args, "diff");
+	argv_array_pushl(&cp.args, "diff", "--submodule=diff", NULL);
+
 	argv_array_pushf(&cp.args, "--line-prefix=%s", line_prefix);
 	if (DIFF_OPT_TST(o, REVERSE_DIFF)) {
 		argv_array_pushf(&cp.args, "--src-prefix=%s%s/",
t/t4060-diff-submodule-option-diff-format.sh +41 -0

45 lines not on this page · raw message

Signature · 1 line
2.13.0.rc1.18.g9ce9a66034
#1 lore raw
Quoted 13 lines · Stefan Beller

When fd47ae6a5b (diff: teach diff to display submodule difference with an inline diff, 2016-08-31) was introduced, we did not think of recursing into nested submodules.

When showing the inline diff for submodules, automatically recurse into nested submodules as well with inline submodule diffs.

---

This is a resend of
https://public-inbox.org/git/[email protected]/

Quoted 6 lines

In the cover letter of that patch, I said I would want to redo the tests with scrubbed output. However given the widespread use of unscrubbed output, I think this is fine as-is to include.

Thanks,
Stefan

Fix looks obviously correct to me. I would like to change the tests to not use the unscrubbed output, but that's a problem for a separate patch.

Thanks,
Jake

#2 lore raw
Quoted 18 lines · Jacob Keller
Quoted 17 lines · Stefan Beller

When fd47ae6a5b (diff: teach diff to display submodule difference with an inline diff, 2016-08-31) was introduced, we did not think of recursing into nested submodules.

When showing the inline diff for submodules, automatically recurse into nested submodules as well with inline submodule diffs.

---

This is a resend of
https://public-inbox.org/git/[email protected]/

In the cover letter of that patch, I said I would want to redo the tests with scrubbed output. However given the widespread use of unscrubbed output, I think this is fine as-is to include.

Quoted 6 lines
Quoted 2 lines

Thanks,
Stefan

Fix looks obviously correct to me. I would like to change the tests to not use the unscrubbed output, but that's a problem for a separate patch.

OK.

Thanks, both.