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

Re: [PATCH 8/9 v13] difftool: teach difftool to handle directory diffs

From
David Aguilar <davvid@gmail.com>
Date
Apr 16, 2012, 01:01 UTC
Message-ID
<CAJDDKr78T1HNFXPPnvMUxBoJhAHP8XGdk9ZbpQCS1sZEQJfR8w@mail.gmail.com>
In-Reply-To
<CAJDDKr7Uw3Nwg4p7F2zaY8f82j3_tRf3WiiO+YSN+nA6a9wY6w@mail.gmail.com>
On Sun, Apr 15, 2012 at 3:20 PM, David Aguilar <davvid@gmail.com> wrote:
Show 46 quoted lines
> On Fri, Apr 13, 2012 at 9:36 AM, Tim Henigan <tim.henigan@gmail.com> wrote:
>> When 'difftool' is called to compare a range of commits that modify
>> more than one file, it opens a separate instance of the diff tool for
>> each file that changed.
>>
>> The new '--dir-diff' option copies all the modified files to a temporary
>> location and runs a directory diff on them in a single instance of the
>> diff tool.
>>
>> Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
>> ---
>>
>> This replaces v12 of the script that was sent to the list on April 12, 2011.
>>
>> Changes in v13:
>>
>> The 'git diff' command is now called via 'Git->repository->command_oneline'
>> again. We need to run the command in a way that allows @ARGV to be given
>> as a list, rather than a string, to insure that IFS and shell meta-
>> characters are handled properly.  Thanks to Junio Hamano for pointing
>> this out [1].
>>
>> [1]: http://thread.gmane.org/gmane.comp.version-control.git/195326/focus=195353
>
> Thanks Tim.  Sorry for reading this patch out of context and missing
> the obvious point that it needs the diff output to do something useful
> in my last review.
>
> I started testing this patch.  I started on the commit before what's
> in pu and then applied this patch:
>
> $ git checkout e9653615fafcbac6109da99fac4fa66b0b432048
> $ git am difftool.patch
>
> The basics work and I know folks will be really happy when this
> feature lands.  Folks have personally asked me for this feature in the
> past.  I dig it.  I'd also like to help pursue using symlinks sometime
> in the future if that sounds like a reasonable thing to you, but the
> stabilizing the existing implementation is more important right now.
>
> I ran into some issues when trying it against a few random commits.  I
> went pretty far back in git's history to see what would happen.
>
> $ git difftool --dir-diff e5b06629de847663aaf0f7daae8de81338da3901 | tail
> Use of uninitialized value $rmode in string eq at
> /home/david/src/git/git-difftool line 96.

I did some more investigating. I think this happens when the diff contains detected renames.

This command made it work:
$ git difftool --dir-diff --no-renames e5b06629de847663aaf0f7daae8de81338da3901
So I think we might need to specify --no-renames when calling git diff --raw.

xxdiff still gives an error message about "$tmp/left/RelNotes: No such file or directory" with --no-renames so we may want to touch some dummy files to make the tools happy.

-- 
David
Previous: David AguilarNext: David Aguilar
Message 3 of 14 in “difftool: teach difftool to handle directory diffs”
  1. 8/9 difftool: teach difftool to handle directory diffsTim Henigan, Apr 13, 2012
  2. David AguilarApr 15, 2012
  3. David AguilarApr 16, 2012
  4. David AguilarApr 16, 2012
  5. Tim HeniganApr 17, 2012
  6. David AguilarApr 18, 2012
  7. Tim HeniganApr 18, 2012
  8. Junio C HamanoApr 18, 2012
  9. Tim HeniganApr 18, 2012
  10. Junio C HamanoApr 18, 2012
  11. Tim HeniganApr 19, 2012
  12. Junio C HamanoApr 19, 2012
  13. David AguilarApr 20, 2012
  14. Tim HeniganApr 20, 2012

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.