Web lists-archives.com

Re: [PATCH 2/5] mergetool: use get_merge_tool function




Hi Eric,

On Mon, Apr 22, 2019 at 03:07:25AM -0400, Eric Sunshine wrote:
> On Mon, Apr 22, 2019 at 1:07 AM Denton Liu <liu.denton@xxxxxxxxx> wrote:
> > [...]
> > Rewrite `get_merge_tool` to return whether or not the tool was guessed
> > and make git-mergetool call this function instead of duplicating the
> > logic. Also, let `$GIT_MERGETOOL_GUI` be set to determine whether or not
> > the guitool will be selected.
> >
> > Signed-off-by: Denton Liu <liu.denton@xxxxxxxxx>
> > ---
> > diff --git a/Documentation/git-mergetool--lib.txt b/Documentation/git-mergetool--lib.txt
> > @@ -28,7 +28,10 @@ to define the operation mode for the functions listed below.
> >  get_merge_tool::
> > -       returns a merge tool.
> > +       returns '$is_guessed:$merge_tool'. '$is_guessed' is 'true' if
> > +       the tool was guessed, else 'false'. '$merge_tool' is the merge
> > +       tool to use. '$GIT_MERGETOOL_GUI' may be set to 'true' to search
> > +       for the appropriate guitool.
> 
> What is the likelihood that code outside of our control is using this
> function? If there is such code, this backward-incompatible change
> will break that code. If the likelihood is excessively small, perhaps
> it is not worth worrying about, otherwise, perhaps this warrants a new
> function with a distinct name.

Thanks for considering this, I hadn't thought about it myself. I assumed
this was an internal function but I guess I was wrong.

I did a bit of digging on GitHub and Google and I found that
git-diffall[1] uses it, although it seems quite old and unmaintained.
Aside from this, I can't find any other open-source programs which use
git-mergetool--lib (and in particular, get_merge_tool) so I believe that
it is pretty rare.

That being said, I'm open to writing a new function so that the change
will be backwards compatible. I'll see what the list has to say.

Thanks,

Denton

[1]: https://github.com/thenigan/git-diffall