Re: [PATCH 3/3] Inform about fast-forwarding of submodules during merge
- From
Elijah Newren <newren@gmail.com>
- Date
- May 16, 2018, 01:36 UTC
- Message-ID
- <CABPp-BH3mi5L+9QKXQAK0sp8z9zzfpwYY9R-itkfOo3CYTUo6g@mail.gmail.com>
- In-Reply-To
- <20180515200030.88731-6-sbeller@google.com>
On Tue, May 15, 2018 at 1:00 PM, Stefan Beller <sbeller@google.com> wrote:
Show 22 quoted lines
> From: Leif Middelschulte <Leif.Middelschulte@gmail.com>
>
> 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>
> ---
> merge-recursive.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/merge-recursive.c b/merge-recursive.c
> index 0571919ee0a..29a430c418a 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, 1, _("Fast-forwarding submodule %s to the following commit:"), path);Seems slightly odd to mix 3 and 1 here; although it'll work just fine, I would have expected use of 3 in both places (much like you did with the 2 and 2 below).
Show 12 quoted lines
> + 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, 1, _("Fast-forwarding submodule %s to the following commit:"), path);Same.
Show 11 quoted lines
> + 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;
> }
>
> --
> 2.17.0.582.gccdcbd54c44.dirtyOther than that nit-pick, looks good to me.