All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: git@vger.kernel.org, leif.middelschulte@gmail.com, newren@gmail.com
Subject: Re: [PATCH 3/3] Inform about fast-forwarding of submodules during merge
Date: Wed, 16 May 2018 10:36:55 +0900	[thread overview]
Message-ID: <xmqqo9hg7554.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20180515200030.88731-6-sbeller@google.com> (Stefan Beller's message of "Tue, 15 May 2018 13:00:30 -0700")

Stefan Beller <sbeller@google.com> writes:

> From: Leif Middelschulte <Leif.Middelschulte@gmail.com>
>

Subject: merge-recursive: give notice when submodule commit gets fast-forwarded

perhaps?

>  	/* 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);
> +			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 */
> +

merge.verbosity::
	Controls the amount of output shown by the recursive merge
	strategy.  Level 0 outputs nothing except a final error
	message if conflicts were detected. Level 1 outputs only
	conflicts, 2 outputs conflicts and file changes.  Level 5 and
	above outputs debugging information.  The default is level 2.
	Can be overridden by the `GIT_MERGE_VERBOSITY` environment variable.

So, by default, we report the fact that we update submodule to a
particular commit, which is quite similar to how we report auto
merged paths using the content level 3-way merge; when you squint
your eyes, the "fast-forward" of submodules look somewhat like a
content-level 3-way merge anyway ;-)

And at level 3, which currently is used to report a non-event that
does not change the result of the merge from what was naturally
expected, we give a bit more detail by citing the commit the
submodule gets fast-forwarded to [*1*].

Sort of makes sense.


[Footnote]

*1* I wonder if that is really necessary, though---we do not give
"here is a diff" or "this is the new contents" after a path gets
merged for normal files.  And if it is needed perhaps because
submodules are so special, I wonder if we also need to give the
commit the submodule gets fast-forwarded from, i.e. the original
one, the same way.

  parent reply	other threads:[~2018-05-16  1:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-15 20:00 [PATCHv2 0/3] Reroll of sb/submodule-merge-in-merge-recursive Stefan Beller
2018-05-15 20:00 ` [PATCH] git-submodule.sh: try harder to fetch a submodule Stefan Beller
2018-05-15 20:00 ` [PATCH] grep: handle corrupt index files early Stefan Beller
2018-05-15 20:00 ` [PATCH 1/3] submodule.c: move submodule merging to merge-recursive.c Stefan Beller
2018-05-15 20:00 ` [PATCH 2/3] merge-recursive: i18n submodule merge output and respect verbosity Stefan Beller
2018-05-16  1:17   ` Junio C Hamano
2018-05-15 20:00 ` [PATCH 3/3] Inform about fast-forwarding of submodules during merge Stefan Beller
2018-05-16  1:36   ` Elijah Newren
2018-05-16  1:36   ` Junio C Hamano [this message]
2018-05-16  1:42   ` Junio C Hamano
2018-06-04 18:48     ` [PATCH v4 0/1] merge-recursive: give notice when submodule commit gets fast-forwarded Leif Middelschulte
2018-06-04 18:48       ` [PATCH 1/1] " Leif Middelschulte
2018-06-07  5:22         ` Elijah Newren
2018-06-11 17:31           ` [PATCH] merge-submodule: reduce output verbosity Leif Middelschulte
2018-06-11 18:04             ` Junio C Hamano
2018-06-11 19:07               ` Leif Middelschulte
2018-05-15 20:02 ` [PATCHv2 0/3] Reroll of sb/submodule-merge-in-merge-recursive Stefan Beller
2018-05-15 20:15 ` Leif Middelschulte
2018-05-15 20:49   ` Stefan Beller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqo9hg7554.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=leif.middelschulte@gmail.com \
    --cc=newren@gmail.com \
    --cc=sbeller@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.