git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/1] Inform about fast-forwarding of submodules during merge

From
Junio C Hamano <gitster@pobox.com>
Date
May 15, 2018, 07:34 UTC
Message-ID
<xmqqzi118j98.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CABPp-BGp_zP8Z2S8FskiNvhNeQH3f=HdnQ39vX6xQz=oSyVfMQ@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
Show 29 quoted lines
> Hi Leif,
>
> On Mon, May 14, 2018 at 1:57 PM, Leif Middelschulte
> <leif.middelschulte@gmail.com> wrote:
>
> Thanks for updating the patch on top of Stefan's series.  :-)
>
>>         /* Case #1: a is contained in b or vice versa */
>>         if (in_merge_bases(commit_a, commit_b)) {
>>                 oidcpy(result, b);
>> +               output(o, 1, _("Note: Fast-forwarding submodule %s to the following commit"), path);
>> +               output_commit_title(o, commit_b);
>
> Level 1 is for conflicts; I don't think this message should have
> higher priority than "Auto-merging $PATH" for normal files, so it
> needs to be 2 (or maybe 3, see below) rather than 1.  (The default
> output level is 2, so it'd still be shown, but we do allow people to
> remove informational message and just get conflicts by setting
> GIT_MERGE_VERBOSITY to 1, or request extra information by setting it
> higher)
>
> Also, this two-line message seems somewhat verbose compared to the
> other messages in merge_submdoule(), and when compared to the simple
> "Auto-merging $PATH" we do for normal files.  The multi-line nature of
> it particularly strikes me; the merge-recursive code has generally
> avoided multi-line messages even for conflicts.
>
> In comparison, your original patch just had ("Fast-forwarding
> submodule %s", path).

FWIW, I share both of your surprises. Between level 2 and 3, after skimming merge-recursive.c for existing use of output levels, I think the situation for non-submodule merges that is closest to these two cases the patch covers for submodules is probably the message given when content merge happened to end up with what we already had. It is part of a normal merge operation that is not a singificant event in the larger picture, yet it is rather rare and interesting when you are curious on events that occur infrequently.

So a one-liner message as everybody else emitted at level 3 or more verbose would probably be a good balance with the remainder of the system, I would think.

Thanks for a review.
Previous: Elijah Newren
Message 15 of 15 in “warn about auto fast-forwarded submodules during merges”
  1. 0/1 warn about auto fast-forwarded submodules during mergesLeif Middelschulte, May 10, 2018
  2. 1/1 Warn about fast-forwarding of submodules during mergeLeif Middelschulte, May 10, 2018
  3. Stefan BellerMay 10, 2018
  4. Leif MiddelschulteMay 10, 2018
  5. 0/2 Submodule merging: i18n, verbosityStefan Beller, May 10, 2018
  6. 1/2 submodule.c: move submodule merging to merge-recursive.cStefan Beller, May 10, 2018
  7. 2/2 merge-recursive: i18n submodule merge output and respect verbosityStefan Beller, May 10, 2018
  8. Elijah NewrenMay 15, 2018
  9. Elijah NewrenMay 11, 2018
  10. Stefan BellerMay 11, 2018
  11. 0/1 rebased: inform about auto submodule ff during mergeLeif Middelschulte, May 14, 2018
  12. 1/1 Inform about fast-forwarding of submodules during mergeLeif Middelschulte, May 14, 2018
  13. Stefan BellerMay 15, 2018
  14. Elijah NewrenMay 15, 2018
  15. Junio C HamanoMay 15, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.