Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeif Middelschulte <Leif.Middelschulte@gmail.com>2018-05-17 21:40:08 +0300
committerJunio C Hamano <gitster@pobox.com>2018-05-18 01:59:13 +0300
commit76f421259718f5f504558e97dfb99e16c9ceb7c6 (patch)
tree945b6bc8416b27cce602329fc4e45d39d42a97ac /merge-recursive.c
parent325f3a8e077c1992a3cc6ff957811e3154edc554 (diff)
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 68d03e4a6e44 ("Implement automatic fast-forward merge for submodules", 2010-07-07)). Signed-off-by: Leif Middelschulte <Leif.Middelschulte@gmail.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 0571919ee0..a9aecccb8c 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1093,10 +1093,26 @@ static int merge_submodule(struct merge_options *o,
/* Case #1: a is contained in b or vice versa */
if (in_merge_bases(commit_a, commit_b)) {
oidcpy(result, b);
+ if (show(o, 3)) {
+ output(o, 3, _("Fast-forwarding submodule %s to the following commit:"), path);
+ output_commit_title(o, commit_b);
+ } else if (show(o, 2))
+ output(o, 2, _("Fast-forwarding submodule %s to %s"), path, oid_to_hex(b));
+ else
+ ; /* no output */
+
return 1;
}
if (in_merge_bases(commit_b, commit_a)) {
oidcpy(result, a);
+ if (show(o, 3)) {
+ output(o, 3, _("Fast-forwarding submodule %s to the following commit:"), path);
+ output_commit_title(o, commit_a);
+ } else if (show(o, 2))
+ output(o, 2, _("Fast-forwarding submodule %s to %s"), path, oid_to_hex(a));
+ else
+ ; /* no output */
+
return 1;
}