# Using kdiff3 to compare two different revisions of a folder

7 messages from 2008-02-13 to 2008-02-17. Participants: André Goddard Rosa, Brian Downing, Robin Rosenberg, Jan Hudec.
Thread: https://gitlist.dev/t/12066

## André Goddard Rosa, 2008-02-13 01:44

Subject: Using kdiff3 to compare two different revisions of a folder
Message-ID: <b8bf37780802121744i62849a53rfa71cc0571aec3a@mail.gmail.com>
URL: https://gitlist.dev/e/b8bf37780802121744i62849a53rfa71cc0571aec3a%40mail.gmail.com

```
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, 2008-02-13 17:44

Subject: Re: Using kdiff3 to compare two different revisions of a folder
Message-ID: <20080213174428.GN27535@lavos.net>
URL: https://gitlist.dev/e/20080213174428.GN27535%40lavos.net
In-Reply-To: <b8bf37780802121744i62849a53rfa71cc0571aec3a@mail.gmail.com>

```
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

```

## Robin Rosenberg, 2008-02-13 22:38

Subject: Re: Using kdiff3 to compare two different revisions of a folder
Message-ID: <200802132338.18449.robin.rosenberg.lists@dewire.com>
URL: https://gitlist.dev/e/200802132338.18449.robin.rosenberg.lists%40dewire.com
In-Reply-To: <b8bf37780802121744i62849a53rfa71cc0571aec3a@mail.gmail.com>

```
onsdagen den 13 februari 2008 skrev André Goddard Rosa:
> 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, 2008-02-14 00:36

Subject: Re: Using kdiff3 to compare two different revisions of a folder
Message-ID: <b8bf37780802131636q698ebb21kc415328c04d8425d@mail.gmail.com>
URL: https://gitlist.dev/e/b8bf37780802131636q698ebb21kc415328c04d8425d%40mail.gmail.com
In-Reply-To: <200802132338.18449.robin.rosenberg.lists@dewire.com>

```
> >     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

```

## André Goddard Rosa, 2008-02-14 00:37

Subject: Re: Using kdiff3 to compare two different revisions of a folder
Message-ID: <b8bf37780802131637t1b7ec2e6he57919fdb7760050@mail.gmail.com>
URL: https://gitlist.dev/e/b8bf37780802131637t1b7ec2e6he57919fdb7760050%40mail.gmail.com
In-Reply-To: <20080213174428.GN27535@lavos.net>

```
On Feb 13, 2008 3:44 PM, Brian Downing <bdowning@lavos.net> wrote:
>
> 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

```

## Jan Hudec, 2008-02-17 10:51

Subject: Re: Using kdiff3 to compare two different revisions of a folder
Message-ID: <20080217105113.GC13178@efreet.light.src>
URL: https://gitlist.dev/e/20080217105113.GC13178%40efreet.light.src
In-Reply-To: <b8bf37780802131636q698ebb21kc415328c04d8425d@mail.gmail.com>

```
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).

-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

```

## André Goddard Rosa, 2008-02-17 11:35

Subject: Re: Using kdiff3 to compare two different revisions of a folder
Message-ID: <b8bf37780802170335r5a3eeb99q40da4d89044bf9e7@mail.gmail.com>
URL: https://gitlist.dev/e/b8bf37780802170335r5a3eeb99q40da4d89044bf9e7%40mail.gmail.com
In-Reply-To: <20080217105113.GC13178@efreet.light.src>

```
On Feb 17, 2008 8:51 AM, Jan Hudec <bulb@ucw.cz> wrote:
> 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

```
