All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Marc Valin <jean-marc.valin@csiro.au>
To: git@vger.kernel.org
Subject: git-kompare
Date: Fri, 24 Aug 2007 15:40:38 +1000	[thread overview]
Message-ID: <46CE6F56.70803@csiro.au> (raw)

[-- 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 -

             reply	other threads:[~2007-08-24  6:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-24  5:40 Jean-Marc Valin [this message]
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

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=46CE6F56.70803@csiro.au \
    --to=jean-marc.valin@csiro.au \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.