git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Rast <trast@student.ethz.ch>
To: Seba Illingworth <seba.illingworth@gmail.com>
Cc: <git@vger.kernel.org>
Subject: Re: difftool, open all diff files immediately, not in serial
Date: Tue, 4 Aug 2009 23:47:46 +0200	[thread overview]
Message-ID: <200908042347.48705.trast@student.ethz.ch> (raw)
In-Reply-To: <loom.20090804T204107-117@post.gmane.org>

Seba Illingworth wrote:
> The default git diff behavior is to open each diff file in serial 
> (wait for previous file to be closed before opening next file).
> 
> I'm looking for a way to open all the files at once - in BeyondCompare 
> for example this would open all the files in tabs within the same BC window.

I posted the script below on IRC the other week[1] in reply to someone
looking for a way to do this for 'meld'.  I'm not sure this is the
*fastest* way to do this, but I'm at least trying to take a few
shortcuts ;-)

Since this is now the second request for such a tool, it would be nice
if you could at least shape this as a contrib/ patch (if it fits your
needs, of course).

[1] http://colabti.org/irclogger/irclogger_log/git?date=2009-07-14#l2180

-- 8< --
#!/bin/sh

. "$(git --exec-path)/git-sh-setup"
cd_to_toplevel # for the tar below

pre="${1-HEAD}"
post="$2"

tmp="$(mktemp -d)"

cleanup () {
	rm -rf $tmp
}

trap cleanup EXIT

mkdir "$tmp"/a "$tmp"/b

if [ -n "$post" ]; then
	git diff --name-only "$pre" "$post" > "$tmp"/filelist
	while read name; do
		mkdir -p "$tmp"/b/"$(dirname "$name")"
		git show "$post":"$name" > "$tmp"/b/"$name"
	done < "$tmp"/filelist
else
	git diff --name-only "$pre" > "$tmp"/filelist
	tar -c -T "$tmp"/filelist | (cd "$tmp"/b && tar -x)
fi

while read name; do
	mkdir -p "$tmp"/a/"$(dirname "$name")"
	git show "$pre":"$name" > "$tmp"/a/"$name"
done < "$tmp"/filelist

cd "$tmp"
#meld a b
diff -ur a b

  reply	other threads:[~2009-08-04 21:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-04 20:49 difftool, open all diff files immediately, not in serial Seba Illingworth
2009-08-04 21:47 ` Thomas Rast [this message]
2009-08-04 22:52   ` Seba Illingworth
2010-04-14  2:16     ` My solution Seb
2010-04-14  6:41       ` David Aguilar
2009-08-20  1:39   ` difftool, open all diff files immediately, not in serial Seba Illingworth

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=200908042347.48705.trast@student.ethz.ch \
    --to=trast@student.ethz.ch \
    --cc=git@vger.kernel.org \
    --cc=seba.illingworth@gmail.com \
    /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).