Skip to content

Commit 76f4212

Browse files
leiflmgitster
authored andcommitted
merge-recursive: give notice when submodule commit gets fast-forwarded
Inform the user about an automatically fast-forwarded submodule. The silent merge behavior was introduced by commit 68d03e4 ("Implement automatic fast-forward merge for submodules", 2010-07-07)). Signed-off-by: Leif Middelschulte <[email protected]> Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 325f3a8 commit 76f4212

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

merge-recursive.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,10 +1093,26 @@ static int merge_submodule(struct merge_options *o,
10931093
/* Case #1: a is contained in b or vice versa */
10941094
if (in_merge_bases(commit_a, commit_b)) {
10951095
oidcpy(result, b);
1096+
if (show(o, 3)) {
1097+
output(o, 3, _("Fast-forwarding submodule %s to the following commit:"), path);
1098+
output_commit_title(o, commit_b);
1099+
} else if (show(o, 2))
1100+
output(o, 2, _("Fast-forwarding submodule %s to %s"), path, oid_to_hex(b));
1101+
else
1102+
; /* no output */
1103+
10961104
return 1;
10971105
}
10981106
if (in_merge_bases(commit_b, commit_a)) {
10991107
oidcpy(result, a);
1108+
if (show(o, 3)) {
1109+
output(o, 3, _("Fast-forwarding submodule %s to the following commit:"), path);
1110+
output_commit_title(o, commit_a);
1111+
} else if (show(o, 2))
1112+
output(o, 2, _("Fast-forwarding submodule %s to %s"), path, oid_to_hex(a));
1113+
else
1114+
; /* no output */
1115+
11001116
return 1;
11011117
}
11021118

0 commit comments

Comments
 (0)