Re: [PATCH v2 06/20] merge-recursive: don't force external callers to do our logging
- From
Elijah Newren <newren@gmail.com>
- Date
- Jul 26, 2019, 23:28 UTC
- Message-ID
- <CABPp-BG35XHN9H9VBYw4JMHknftMhB6u3H=CDFHhM7EMinQNSQ@mail.gmail.com>
- In-Reply-To
- <xmqq36iso9gb.fsf@gitster-ct.c.googlers.com>
On Fri, Jul 26, 2019 at 12:57 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 23 quoted lines
> > Elijah Newren <newren@gmail.com> writes: > > > Alternatively, you can view this as "make the merge functions behave > > more similarly." merge-recursive has three different entry points: > > merge_trees(), merge_recursive(), and merge_recursive_generic(). Two of > > these would call diff_warn_rename_limit(), but merge_trees() didn't. > > This lead to callers of merge_trees() needing to manually call > > diff_warn_rename_limit() themselves. Move this to the new > > merge_finalize() function to make sure that all three entry points run > > this function. > > Interesting. It seems that b520abf1c8f did a suboptimal jobs but > this step cleans it up quite nicely. > > Are there callers of merge_trees() in other codepaths, and do they > want this change? > > There is only one, builtin/checkout.c::merge_working_tree(), which > is used when switching to a different commit. I think it would not > hurt to give the same warning (but I also think it would not hurt to > simply disable rename detection in that context); we should record > the whatever decision we make in the log message.
I was surprised to read this because I thought I did that...but I guess that was in patch 15 for a slightly different case. Yeah, I can add some words to the commit message about this.