threads / discuss / 12066

Using kdiff3 to compare two different revisions of a folder

Subject: Using kdiff3 to compare two different revisions of a folder

## tl;dr

7 messages between Feb 13, 2008 and Feb 17, 2008.

replies: 6people: 4as markdown or json

André Goddard Rosa· Feb 13, 2008, 01:44 UTC · lore
Hi, all!
    I would like to use kdiff3 to compare some folder like "include"
between two different revisions.
    It would be something like "git diff v2.5:makefile HEAD:makefile",
but for an entire folder.
    Kdiff3 give me a quick glance of its nice graphical output of the
differences, without have to resort to looking/parsing 'git log'
output.
    For now, easiest way for me is to keep my tree replicated in two
different folders pointing to different revisions then use it.
    Is there a better way to do this kind of comparison?
Thanks in advance,
-- 
[]s,
André Goddard
Brian Downing· Feb 13, 2008, 17:44 UTC · re: André Goddard Rosa · lore

Re: Using kdiff3 to compare two different revisions of a folder

On Tue, Feb 12, 2008 at 11:44:07PM -0200, André Goddard Rosa wrote:
Show 12 quoted lines
>     I would like to use kdiff3 to compare some folder like "include"
> between two different revisions.
>     It would be something like "git diff v2.5:makefile HEAD:makefile",
> but for an entire folder.
> 
>     Kdiff3 give me a quick glance of its nice graphical output of the
> differences, without have to resort to looking/parsing 'git log'
> output.
>     For now, easiest way for me is to keep my tree replicated in two
> different folders pointing to different revisions then use it.
> 
>     Is there a better way to do this kind of comparison?

Maybe you want something like this? This uses kdiff3 to compare two full commits, by extracting the changed files into a temporary location. Modifying it so it can work with path limiters and/or take arguments exactly like 'git diff' is left as an excercise for the reader.

-bcd
#!/bin/sh -e
# usage: git-kdiff3 commit1 commit2

SUBDIRECTORY_OK=1 . git-sh-setup cd_to_toplevel

O=".git-kdiff3-tmp-$$" list="$O/list" trap "rm -rf $O" 0 mkdir $O

git diff --name-only -z $1 $2 > $list

cat $list | xargs -0 git archive --prefix=a/ $1 | tar xf - -C $O cat $list | xargs -0 git archive --prefix=b/ $2 | tar xf - -C $O

kdiff3 $O/a $O/b
André Goddard Rosa· Feb 14, 2008, 00:37 UTC · re: Brian Downing · lore

Re: Using kdiff3 to compare two different revisions of a folder

On Feb 13, 2008 3:44 PM, Brian Downing <bdowning@lavos.net> wrote:
Show 42 quoted lines
>
> On Tue, Feb 12, 2008 at 11:44:07PM -0200, André Goddard Rosa wrote:
> >     I would like to use kdiff3 to compare some folder like "include"
> > between two different revisions.
> >     It would be something like "git diff v2.5:makefile HEAD:makefile",
> > but for an entire folder.
> >
> >     Kdiff3 give me a quick glance of its nice graphical output of the
> > differences, without have to resort to looking/parsing 'git log'
> > output.
> >     For now, easiest way for me is to keep my tree replicated in two
> > different folders pointing to different revisions then use it.
> >
> >     Is there a better way to do this kind of comparison?
>
> Maybe you want something like this?  This uses kdiff3 to compare two
> full commits, by extracting the changed files into a temporary location.
> Modifying it so it can work with path limiters and/or take arguments
> exactly like 'git diff' is left as an excercise for the reader.
>
> -bcd
>
> #!/bin/sh -e
>
> # usage: git-kdiff3 commit1 commit2
>
> SUBDIRECTORY_OK=1
> . git-sh-setup
> cd_to_toplevel
>
> O=".git-kdiff3-tmp-$$"
> list="$O/list"
> trap "rm -rf $O" 0
> mkdir $O
>
> git diff --name-only -z $1 $2 > $list
>
> cat $list | xargs -0 git archive --prefix=a/ $1 | tar xf - -C $O
> cat $list | xargs -0 git archive --prefix=b/ $2 | tar xf - -C $O
>
> kdiff3 $O/a $O/b
>
Thanks a lot, it works like a charm! :)
-- 
[]s,
André Goddard
Robin Rosenberg· Feb 13, 2008, 22:38 UTC · re: André Goddard Rosa · lore

Re: Using kdiff3 to compare two different revisions of a folder

onsdagen den 13 februari 2008 skrev André Goddard Rosa:
Show 14 quoted lines
> Hi, all!
> 
>     I would like to use kdiff3 to compare some folder like "include"
> between two different revisions.
>     It would be something like "git diff v2.5:makefile HEAD:makefile",
> but for an entire folder.
> 
>     Kdiff3 give me a quick glance of its nice graphical output of the
> differences, without have to resort to looking/parsing 'git log'
> output.
>     For now, easiest way for me is to keep my tree replicated in two
> different folders pointing to different revisions then use it.
> 
>     Is there a better way to do this kind of comparison?
Yes.
	git diff <whatever options> | kompare -
-- robin
André Goddard Rosa· Feb 14, 2008, 00:36 UTC · re: Robin Rosenberg · lore

Re: Using kdiff3 to compare two different revisions of a folder

Show 5 quoted lines
> >     Is there a better way to do this kind of comparison?
>
> Yes.
>         git diff <whatever options> | kompare -
>
Thanks, Robin! It works too.
-- 
[]s,
André Goddard
Jan Hudec· Feb 17, 2008, 10:51 UTC · re: André Goddard Rosa · lore

Re: Using kdiff3 to compare two different revisions of a folder

On Wed, Feb 13, 2008 at 22:36:34 -0200, André Goddard Rosa wrote:
Show 7 quoted lines
> > >     Is there a better way to do this kind of comparison?
> >
> > Yes.
> >         git diff <whatever options> | kompare -
> >
> 
> Thanks, Robin! It works too.

It should be noted, that kompare seems to be the only graphical tool willing to accept patch instead of two trees. Unfortunately it does not seem possible to install it without KDE, not to speak about Windows (where kdiff3 works quite well).

-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
André Goddard Rosa· Feb 17, 2008, 11:35 UTC · re: Jan Hudec · lore

Re: Using kdiff3 to compare two different revisions of a folder

On Feb 17, 2008 8:51 AM, Jan Hudec <bulb@ucw.cz> wrote:
Show 14 quoted lines
> On Wed, Feb 13, 2008 at 22:36:34 -0200, André Goddard Rosa wrote:
> > > >     Is there a better way to do this kind of comparison?
> > >
> > > Yes.
> > >         git diff <whatever options> | kompare -
> > >
> >
> > Thanks, Robin! It works too.
>
> It should be noted, that kompare seems to be the only graphical tool willing
> to accept patch instead of two trees. Unfortunately it does not seem possible
> to install it without KDE, not to speak about Windows (where kdiff3 works
> quite well).
>
Yes, it is true. Patch support is not yet implemented on kdiff3.
Best regards,
-- 
[]s,
André Goddard

← back to recent threads