# git-kompare

5 messages from 2007-08-24 to 2007-08-25. Participants: Jean-Marc Valin, Andy Parkins, Robin Rosenberg.
Thread: https://gitlist.dev/t/9632

## Jean-Marc Valin, 2007-08-24 05:40

Subject: git-kompare
Message-ID: <46CE6F56.70803@csiro.au>
URL: https://gitlist.dev/e/46CE6F56.70803%40csiro.au

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


#!/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 -

```

## Andy Parkins, 2007-08-24 17:13

Subject: Re: git-kompare
Message-ID: <200708241813.48012.andyparkins@gmail.com>
URL: https://gitlist.dev/e/200708241813.48012.andyparkins%40gmail.com
In-Reply-To: <46CE6F56.70803@csiro.au>

```
On Friday 2007, August 24, Jean-Marc Valin wrote:

> (http://mail.kde.org/pipermail/kompare-devel/2006-August/000141.html
> which is fixed in some later version of kompare I think)

I was the original reporter of that bug; I have to say the kompare 
developers were fairly quick on the uptake and fixed that problem with the 
next realease of kompare - which came very soon after the report.  I just 
waited for it to arrive in debian unstable, which also happened fairly 
quickly.  If you are seriously that far behind in your kompare version I 
strongly suggest upgrading, I mean, if it's in debian then it's in 
everything else :-)

I found it quite nostalgic seeing that report, as I made the report a few 
days after my first use of git, which means I've just had my git 
anniversary.  How quickly time flys - I can hardly believe I ever managed 
without it now.



Andy
-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com

```

## Robin Rosenberg, 2007-08-24 19:52

Subject: Re: git-kompare
Message-ID: <200708242152.09176.robin.rosenberg.lists@dewire.com>
URL: https://gitlist.dev/e/200708242152.09176.robin.rosenberg.lists%40dewire.com
In-Reply-To: <200708241813.48012.andyparkins@gmail.com>

```
fredag 24 augusti 2007 skrev Andy Parkins:
> On Friday 2007, August 24, Jean-Marc Valin wrote:
> 
> > (http://mail.kde.org/pipermail/kompare-devel/2006-August/000141.html
> > which is fixed in some later version of kompare I think)
> 
> I was the original reporter of that bug; I have to say the kompare 
> developers were fairly quick on the uptake and fixed that problem with the 
> next realease of kompare - which came very soon after the report.  I just 
I am more of a GIT developer than a KDE developer.

> waited for it to arrive in debian unstable, which also happened fairly 
> quickly.  If you are seriously that far behind in your kompare version I 
> strongly suggest upgrading, I mean, if it's in debian then it's in 
> everything else :-)

Adding the patch to your version isn't hard. Just download the source package
and add the patch in the patches section and rebuild. That's how I lived with
the fix until Mandriva delivered a newer KDE version. Thanks to the kdesdk src
rpm I could rebuild the package fairly easily without dowloading, configuring
and builing most of KDE. The src rpm declare the dependencies I need. My 
guess is that is about as easy with dpkg, ebuilds or ports.

> I found it quite nostalgic seeing that report, as I made the report a few 
> days after my first use of git, which means I've just had my git 
> anniversary.  How quickly time flys - I can hardly believe I ever managed 
> without it now.

This was about two months after starting to use git in my case. My first git bug was
encountered abour ten minutes after trying git. (Linus fixed the bug the day after).

-- robin

```

## Jean-Marc Valin, 2007-08-25 00:17

Subject: Re: git-kompare
Message-ID: <46CF7509.5080206@csiro.au>
URL: https://gitlist.dev/e/46CF7509.5080206%40csiro.au
In-Reply-To: <200708242152.09176.robin.rosenberg.lists@dewire.com>

```
> Adding the patch to your version isn't hard. Just download the source package
> and add the patch in the patches section and rebuild. That's how I lived with
> the fix until Mandriva delivered a newer KDE version. Thanks to the kdesdk src
> rpm I could rebuild the package fairly easily without dowloading, configuring
> and builing most of KDE. The src rpm declare the dependencies I need. My 
> guess is that is about as easy with dpkg, ebuilds or ports.

Unless I missed something, there are more things to work around than the
one that was fixed in your patch, no? For example, the fact that kompare
doesn't understand when the filename is /dev/null. As for upgrading
kompare, I'm all for the idea, but the KDE folks aren't making that
easy. The only link in the Kompare download section is for www.kde.org,
which isn't making the source code any easier to find (including a 404
link for "Source code" on the front page!). Any direct link?

BTW, I'm running the latest Ubuntu (Feisty) that ships with kompare 3.4.

	Jean-Marc

```

## Robin Rosenberg, 2007-08-25 10:25

Subject: Re: git-kompare
Message-ID: <200708251225.08141.robin.rosenberg.lists@dewire.com>
URL: https://gitlist.dev/e/200708251225.08141.robin.rosenberg.lists%40dewire.com
In-Reply-To: <46CF7509.5080206@csiro.au>

```
lördag 25 augusti 2007 skrev Jean-Marc Valin:
> > Adding the patch to your version isn't hard. Just download the source package
> > and add the patch in the patches section and rebuild. That's how I lived with
> > the fix until Mandriva delivered a newer KDE version. Thanks to the kdesdk src
> > rpm I could rebuild the package fairly easily without dowloading, configuring
> > and builing most of KDE. The src rpm declare the dependencies I need. My 
> > guess is that is about as easy with dpkg, ebuilds or ports.
> 
> Unless I missed something, there are more things to work around than the
> one that was fixed in your patch, no? For example, the fact that kompare
> doesn't understand when the filename is /dev/null. As for upgrading

I'm on 3.5.7 now so I cannot easily test 3.5.6 with the patch anymore, but
on *my machine* diffs (including git diffs) with /dev/null work just fine.

-- robin

> kompare, I'm all for the idea, but the KDE folks aren't making that
> easy. The only link in the Kompare download section is for www.kde.org,
> which isn't making the source code any easier to find (including a 404
> link for "Source code" on the front page!). Any direct link?

I suggested *not* to upgrade completely. Go to ubunu's home page
and look for package sources and how to modify them. Ubuntu uses
the same package format as Debian so instructions for Debian will
most likely apply for Ubuntu.

- robin

```
