git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-kompare
@ 2007-08-24  5:40 Jean-Marc Valin
  2007-08-24 17:13 ` git-kompare Andy Parkins
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Marc Valin @ 2007-08-24  5:40 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 966 bytes --]

Hi,

I just wrote this tiny git-kompare script that I thought some may be
interested in. It basically does a visual diff using kompare. If it
weren't for bugs in kompare, the script would basically do:

git diff --unified=99999 $* | kompare -

As you can see, I really suck at shell programming, so this isn't
intended for being merged, although probably anyone with a clue about
shell can probably rewrite it in a slightly cleaner way. At the moment,
the only case it doesn't handle is when a file gets added and the
initial source is /dev/null.

Bugs it works around are:
- Unrecognised git syntax
(http://mail.kde.org/pipermail/kompare-devel/2006-August/000141.html
which is fixed in some later version of kompare I think)
- Kompare doesn't know about /dev/null as a file (fixed only for removal)
- Kompare doesn't like it when the first file in the diff isn't in the
root of the repository.

Hope it's useful for someone (I really like it).

Cheers,

	Jean-Marc

[-- Attachment #2: git-kompare --]
[-- Type: text/plain, Size: 263 bytes --]

#!/bin/sh
(echo "Index: a\n--- a\n+++ a\n@@ -1,1 +1,1 @@\n-\n+\n"; git diff --unified=99999 $* | perl -ne 's/\/dev\/null/toto/; if (/^\+\+\+/) {s/^\+\+\+ b\/(.*)$/+++ $1\t(old version)/;} if (/^---/) {s/^--- a\/(.*)$/--- $1\t(new version)/;} print;') | kompare -

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-08-25 21:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-24  5:40 git-kompare Jean-Marc Valin
2007-08-24 17:13 ` git-kompare Andy Parkins
2007-08-24 19:52   ` git-kompare Robin Rosenberg
2007-08-25  0:17     ` git-kompare Jean-Marc Valin
2007-08-25 10:25       ` git-kompare Robin Rosenberg

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