git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: bdowning@lavos.net (Brian Downing)
To: "André Goddard Rosa" <andre.goddard@gmail.com>
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 11:44:28 -0600	[thread overview]
Message-ID: <20080213174428.GN27535@lavos.net> (raw)
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

  reply	other threads:[~2008-02-13 17:45 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 [this message]
2008-02-14  0:37   ` André Goddard Rosa
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=20080213174428.GN27535@lavos.net \
    --to=bdowning@lavos.net \
    --cc=andre.goddard@gmail.com \
    --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).