Re: [PATCH v2 08/13] merge-tree: support including merge messages in output
- From
Elijah Newren <newren@gmail.com>
- Date
- Feb 2, 2022, 23:09 UTC
- Message-ID
- <CABPp-BHA-w5g5gkVOrxaXEEvDA1jhmge+AA8DOBG-r-o3RwGBQ@mail.gmail.com>
- In-Reply-To
- <xmqqh79hx8g1.fsf@gitster.g>
On Wed, Feb 2, 2022 at 1:30 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 19 quoted lines
> > "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes: > > > +By default, for a successful merge, the output from git-merge-tree is > > +simply one line: > > + > > + <OID of toplevel tree> > > + > > +Whereas for a conflicted merge, the output is by default of the form: > > > > <OID of toplevel tree> > > + <Informational messages> > > Sounds useful. This made me wonder, as the only shuffling of the > output destination in the past few steps were to send the output to > some "FILE *", how you send the findings you make while coming up > with the result _after_ the result. It turns out that the ORT > machinery already buffers these findings in a strbuf per path, so > there is no trouble doing so ;-)
:-)
Show 5 quoted lines
> It still makes me wonder how the "send rename warnings to the > standard output stream, instead of the standard error stream" change > interacts with this change, though. That needs to be done way > before you finish computing the result, and it does not seem to be > buffered in-core, like per-path conflict information messages.
Actually, that's also stashed away in detect_regular_renames() from merge-ort.c:
if (diff_opts.needed_rename_limit > renames->needed_limit)
renames->needed_limit = diff_opts.needed_rename_limit;and then the call to diff_warn_rename_limit() is deferred until after all the informational messages are printed. Also, this series modifies diff_warn_rename_limit() later to allow it to send that message to a different stream.