git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "André Goddard Rosa" <andre.goddard@gmail.com>
To: "Brian Downing" <bdowning@lavos.net>
Cc: "Git Mailing List" <git@vger.kernel.org>
Subject: Re: Using kdiff3 to compare two different revisions of a folder
Date: Wed, 13 Feb 2008 22:37:18 -0200	[thread overview]
Message-ID: <b8bf37780802131637t1b7ec2e6he57919fdb7760050@mail.gmail.com> (raw)
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

  reply	other threads:[~2008-02-14  0:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-13  1:44 Using kdiff3 to compare two different revisions of a folder André Goddard Rosa
2008-02-13 17:44 ` Brian Downing
2008-02-14  0:37   ` André Goddard Rosa [this message]
2008-02-13 22:38 ` Robin Rosenberg
2008-02-14  0:36   ` André Goddard Rosa
2008-02-17 10:51     ` Jan Hudec
2008-02-17 11:35       ` André Goddard Rosa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b8bf37780802131637t1b7ec2e6he57919fdb7760050@mail.gmail.com \
    --to=andre.goddard@gmail.com \
    --cc=bdowning@lavos.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).