Re: [PATCH 6/7] merge-ort: upon merge abort, only show messages causing the abort
- From
Elijah Newren <newren@gmail.com>
- Date
- Jun 19, 2024, 02:58 UTC
- Message-ID
- <CABPp-BHAcXG=C5i0anuAxm0qb0i-i8AcbQXyQ4Rz4azWA0SU1A@mail.gmail.com>
- In-Reply-To
- <CAPig+cSZPC=41w8kG6n5hdSCUC4+jYJ6cM8UC-WCO3Bcmb2iNA@mail.gmail.com>
On Fri, Jun 14, 2024 at 4:19 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 42 quoted lines
>
> On Thu, Jun 13, 2024 at 4:25 PM Elijah Newren via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
> > When something goes wrong enough that we need to abort early and not
> > even attempt merging the remaining files, it probably does not make
> > sense to report conflicts messages for the subset of files we processed
> > before hitting the fatal error. Instead, only show the messages
> > associated with paths where we hit the fatal error. Also, print these
> > messages to stderr rather than stdout.
> >
> > Signed-off-by: Elijah Newren <newren@gmail.com>
> > ---
> > diff --git a/merge-ort.c b/merge-ort.c
> > @@ -543,10 +543,24 @@ enum conflict_and_info_types {
> > - CONFLICT_SUBMODULE_CORRUPT,
> > +
> > + /* INSERT NEW ENTRIES HERE */
> > + /*
> > + * Something is seriously wrong; cannot even perform merge;
> > + * Keep this group _last_ other than NB_CONFLICT_TYPES
> > + */
>
> I'm probably missing something obvious, but here the new comment talks
> about NB_CONFLICT_TYPES...
>
> > + ERROR_SUBMODULE_CORRUPT,
> >
> > /* Keep this entry _last_ in the list */
> > - NB_CONFLICT_TYPES,
> > + NB_TOTAL_TYPES,
>
> ... but NB_CONFLICT_TYPES gets removed here.
>
> > @@ -1828,9 +1845,9 @@ static int merge_submodule(struct merge_options *opt,
> > - _("Failed to merge submodule %s "
> > + _("error: failed to merge submodule %s "
> > @@ -1848,7 +1865,7 @@ static int merge_submodule(struct merge_options *opt,
> > _("Failed to merge submodule %s "
> > "(repository corrupt)"),
>
> Do you also want to apply the same "error: failed..." transformation
> to this error message as you did to other error messages?Doh, I tried to re-read through my patches after making numerous additional tweaks to try to catch stuff like this, but I clearly missed a few cases here. Thanks for catching both of these issues; I'll fix them up.