git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: difftool, open all diff files immediately, not in serial

From
Thomas Rast <trast@student.ethz.ch>
Date
Aug 4, 2009, 21:47 UTC
Message-ID
<200908042347.48705.trast@student.ethz.ch>
In-Reply-To
<loom.20090804T204107-117@post.gmane.org>
Seba Illingworth wrote:
Show 5 quoted lines
> 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

Previous: Seba IllingworthNext: Seba Illingworth
Message 2 of 6 in “difftool, open all diff files immediately, not in serial”
  1. Seba IllingworthAug 4, 2009
  2. Thomas RastAug 4, 2009
  3. Seba IllingworthAug 4, 2009
  4. My solutionSeb, Apr 14, 2010
  5. David AguilarApr 14, 2010
  6. Seba IllingworthAug 20, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.