All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Kolejka" <Thomas.Kolejka@gmx.at>
To: Bruno Haible <bruno@clisp.org>
Cc: git@vger.kernel.org, junkio@cox.net
Subject: Re: git: how to produce context diffs?
Date: Mon, 27 Nov 2006 19:33:46 +0100	[thread overview]
Message-ID: <20061127183346.30010@gmx.net> (raw)
In-Reply-To: <200611271516.30425.bruno@clisp.org>

Hello,

I'm using the following script 'external-diff.sh':

--
# path old-file old-hex old-mode new-file new-hex new-mode
# $1   $2       $3      $4       $5       $6      $7

old_hex=$3
new_hex=`git-hash-object $5`

if [ "$old_hex" = "$new_hex" ]
then
	exit 0
fi

echo "diff --git a/$1 b/$1"
echo "index ${old_hex:0:7}..${new_hex:0:7} $4"

diff -L a/$1 -L b/$1 -pc $2 $5

exit 0
--

which can be called by:

export GIT_EXTERNAL_DIFF=external-diff.sh
git-diff-index master -p > my.patch



Bye,
Thomas Kolejka

-- 
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's C

  parent reply	other threads:[~2006-11-27 18:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-27 14:16 git: how to produce context diffs? Bruno Haible
2006-11-27 14:27 ` Jakub Narebski
2006-11-27 15:19   ` Sean
2006-11-27 16:05     ` Jakub Narebski
2006-11-27 17:06       ` Sean
2006-11-27 15:38   ` Sean
2006-11-27 18:33 ` Thomas Kolejka [this message]
2006-11-27 19:18 ` Junio C Hamano

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=20061127183346.30010@gmx.net \
    --to=thomas.kolejka@gmx.at \
    --cc=bruno@clisp.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /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.