Re: git-difftool

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 2, 2009 at 8:10 AM, Matthieu Moy <Matthieu.Moy@xxxxxxx> wrote:
>
> As done with "vimdiff" in another message, simply write a
> one-liner wrapper script that calls xxdiff $2 $3, and call this
> wrapper script.
>
> ...
>
> Right, but a script "git-difftool" calling the later is a one-liner,
> so 2 one-liners give you the same result as the ~500 lines script
> proposed. And GIT_EXTERNAL_DIFF has the great advantage
> of being maintained together with git, and will most likely handle
> all cases (diff between index, working tree, arbitrary commit, ...)
> correctly.
>
> --
> Matthieu
>

Thanks for the feedback.  I've done exactly what you suggested.

I now have a git-difftool wrapper script that basically just sets up
the environment for git-difftool-helper.  git-difftool-helper does all
of the merge tool configuration stuff ala
http://www.kernel.org/pub/software/scm/git/docs/git-mergetool.html (it
uses the same git config variables and thus works with existing custom
commands).  If you drop them both into the same directory it should
work as-is (it munges $PATH).

It's not a two-liner (they do all that git config stuff and handle
more than just vimdiff) but it does use GIT_EXTERNAL_DIFF now, which
makes the script infinitely more useful.  This is much nicer now since
you can pass any 'git diff' options to git-difftool and it'll handle
it correctly.

The usage is simpler now too:

usage: git difftool [--no-prompt] [--tool=tool] ["git diff" options]


Thanks for your help,

-- 
    David

Attachment: git-difftool
Description: Binary data

Attachment: git-difftool-helper
Description: Binary data


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux