git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCh] jit-trackdown
@ 2005-04-29 16:03 David Greaves
  2005-04-29 18:47 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: David Greaves @ 2005-04-29 16:03 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: GIT Mailing Lists

Hi Junio

Excellent tool :)
Should really be cg-trackdown

David


This patch allows the use of symbolic commits from Cogito's
.git/refs/heads and tags structure eg:
  jit-trackdown HEAD etc/db/schema.sql
or
  jit-trackdown v3.2 etc/db/schema.sql


Signed-off-by: David Greaves <david@dgreaves.com>
---


--- jit-trackdown.orig  2005-04-29 16:57:40.278707704 +0100
+++ jit-trackdown       2005-04-29 16:47:16.495483693 +0100
@@ -1,6 +1,8 @@
 #!/bin/sh

 # Usage: jit-trackdown <commit> paths...
+# <commit> can be the symbolic name HEAD
+# or a tag or head identifier.

 tmp=.jit-trackdown.$$
 hits=$tmp-hits
@@ -10,6 +12,14 @@
 tty -s || to_tty=:

 head="$1"
+if [ $head == "HEAD" ]; then
+  head=$(cat .git/HEAD)
+elif [ -f .git/refs/tags/$head ]; then
+  head=$(cat .git/refs/tags/$head)
+elif [ -f .git/refs/heads/$head ]; then
+  head=$(cat .git/refs/heads/$head)
+fi
+
 shift
 rev-list "$head" |
 while read commit


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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-29 16:03 [PATCh] jit-trackdown David Greaves
2005-04-29 18:47 ` Junio C Hamano
2005-04-29 21:40   ` Daniel Barkalow
2005-04-29 22:09     ` Junio C Hamano

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