git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-difftool

From
David Aguilar <davvid@gmail.com>
Date
Dec 31, 2008, 20:11 UTC
Message-ID
<402731c90812311211p548c49d3p100f79ddee7163b0@mail.gmail.com>
In-Reply-To
<vpqhc4kz5zh.fsf@bauges.imag.fr>
On Wed, Dec 31, 2008 at 8:04 AM, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:
Show 19 quoted lines
> David Aguilar <davvid@gmail.com> writes:
>
>> The usual use case for this script is when you have either
>> staged or unstaged changes and you'd like to see the changes
>> in a side-by-side diff viewer (e.g. xxdiff, tkdiff, etc).
>>
>>       git difftool [<filename>*]
>
> Is it not a complex way of saying
>
>        GIT_EXTERNAL_DIFF=xxdiff git diff
>
> ?
>
> (My 2 cents, and happy new year ;-)
>
> --
> Matthieu
>

Hmm... in theory, yes, but in practice, no. xxdiff is too gimp to handle what 'git diff' hands it =)

For example:

$ GIT_EXTERNAL_DIFF=echo git diff test test /tmp/.diff_1dh4TW 9daeafb9864cf43055ae93beb0afd6c7d144bfa4 100644 test 0000

$ GIT_EXTERNAL_DIFF=xxdiff git diff test xxdiff (cmdline.cpp:762): You can specify at most 3 filenames. Extra arguments: " 100644 test 0000000000000000000000000000000000000000 100644" Use 'xxdiff --help' for more information. external diff died, stopping at test.

I checked the git-diff documentation and could not find a way to inhibit the sha1, mode, etc. args that are sent to GIT_EXTERNAL_DIFF (nor should there be, I presume).

I'm all for finding the simplest way and GIT_EXTERNAL_DIFF seems like the right entry point. What I should do is change the script so that it handles all of the choosing-a-merge-tool-logic and just have git call it via GIT_EXTERNAL_DIFF. That would definitely simplify the script since 'git diff' would be handling all of the tmp file and option processing logic. wow, I really like that idea. Thanks for the tip!

Happy new year,
-- 
    David
Previous: Matthieu MoyNext: Boyd Stephen Smith Jr.
Message 3 of 16 in “git-difftool”
  1. David AguilarDec 26, 2008
  2. Matthieu MoyDec 31, 2008
  3. David AguilarDec 31, 2008
  4. Boyd Stephen Smith Jr.Dec 31, 2008
  5. Matthieu MoyJan 1, 2009
  6. Markus HeidelbergJan 2, 2009
  7. Matthieu MoyJan 2, 2009
  8. David AguilarJan 2, 2009
  9. Markus HeidelbergJan 15, 2009
  10. David AguilarJan 16, 2009
  11. Ping YinJan 1, 2009
  12. Markus HeidelbergJan 2, 2009
  13. Ping YinJan 2, 2009
  14. ensoJan 17, 2009
  15. David AguilarJan 17, 2009
  16. Ping YinJan 17, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.