git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [script] ge: export commits as patches
@ 2005-04-19 13:48 Ingo Molnar
  2005-04-19 17:03 ` Petr Baudis
  2005-04-20 17:21 ` Zlatko Calusic
  0 siblings, 2 replies; 8+ messages in thread
From: Ingo Molnar @ 2005-04-19 13:48 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git


is there any 'export commit as patch' support in git-pasky? I didnt find 
any such command (maybe it got added meanwhile), so i'm using the 'ge' 
hack below.

e.g. i typically look at commits via 'git log', and then when i see 
something interesting, i look at the commit via the 'ge' script. E.g.  
"ge 834f6209b22af2941a8640f1e32b0f123c833061" done in the kernel tree 
will output a particular commit's header and the patch.

	Ingo

#!/bin/bash

if [ $# != 1 ]; then
 echo 'ge <commit-ID>'
 exit -1
fi
TREE1=$(cat-file commit 2>/dev/null $1 | head -4 | grep ^tree | cut -d' ' -f2)
if [ "$TREE1" = "" ]; then echo 'ge <commit-ID>'; exit -1; fi
PARENT=$(cat-file commit 2>/dev/null $1 | head -4 | grep ^parent | cut -d' ' -f2)
if [ "$PARENT" = "" ]; then echo 'ge <commit-ID>'; exit -1; fi
TREE2=$(cat-file commit 2>/dev/null $PARENT | head -4 | grep ^tree | cut -d' ' -f2)
if [ "$TREE2" = "" ]; then echo 'ge <commit-ID>'; exit -1; fi

cat-file commit $1
echo
git diff -r $TREE2:$TREE1


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

end of thread, other threads:[~2005-04-20 17:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-19 13:48 [script] ge: export commits as patches Ingo Molnar
2005-04-19 17:03 ` Petr Baudis
2005-04-19 18:56   ` Ingo Molnar
2005-04-19 19:41     ` Petr Baudis
2005-04-20  2:34       ` David A. Wheeler
2005-04-19 19:11   ` Greg KH
2005-04-19 22:56   ` David A. Wheeler
2005-04-20 17:21 ` Zlatko Calusic

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