threads / bug / 29029

[BUG] difftool falls back to normal diff when used during merge resolution

Subject: [BUG] difftool falls back to normal diff when used during merge resolution

## tl;dr

2 messages between Nov 27, 2011 and Nov 28, 2011.

replies: 1people: 2as markdown or json

Jakub Turski· Nov 27, 2011, 18:09 UTC · lore
Hello there,

Just found this behavior, and after a chat on IRC it looks to me like an actual bug. I have 'git difftool' configured to use vimdiff - and it worked fine. Despite that config, git still falls back to plain diff when I launch difftool mid-way through merge conflict resolution.

Here's a reproducable testcase (w/ version 1.7.7.3)

$ mkdir a; cd a; git init; echo A>A; git add A; git commit -m A; git branch alt; echo AA>A; git commit -am AA; git checkout alt; echo B>A; git commit -m B; git commit -am B; git checkout master; git merge alt; git difftool -t vimdiff A

Results: http://pastie.org/2929336

KT.
David Aguilar· Nov 28, 2011, 11:16 UTC · re: Jakub Turski · lore

Re: [BUG] difftool falls back to normal diff when used during merge resolution

On Nov 27, 2011, at 10:09 AM, Jakub Turski <yacoob@gmail.com> wrote:
Show 16 quoted lines
> Hello there,
>
> Just found this behavior, and after a chat on IRC it looks to me like
> an actual bug. I have 'git difftool' configured to use vimdiff - and
> it worked fine. Despite that config, git still falls back to plain
> diff when I launch difftool mid-way through merge conflict resolution.
>
> Here's a reproducable testcase (w/ version 1.7.7.3)
>
> $ mkdir a; cd a; git init; echo A>A; git add A; git commit -m A; git
> branch alt; echo AA>A; git commit -am AA; git checkout alt; echo B>A;
> git commit -m B; git commit -am B; git checkout master; git merge alt;
> git difftool -t vimdiff A
>
> Results:
> http://pastie.org/2929336

I think this is an unfortunate case where the implementation leaks into the user experience.

I haven't checked, but I'm pretty sure this is because GIT_EXTERNAL_DIFF has no affect when the conflicts exist.

git mergetool can be used in this situation.

We could do a check up front in difftool to see whether conflicts exist and exit with an error message. The difftool script is quite small and basically a very thin wrapper around git diff, though, so I do hesitate before making it more complicated.

anyways, try "git mergetool".
-- 
            David

← back to recent threads