git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Add "--branches", "--tags" and "--remotes" options to git-rev-parse.

From
Sean <seanlkml@sympatico.ca>
Date
May 15, 2006, 00:07 UTC
Message-ID
<BAYC1-PASMTP079744DE4B299C5B567F30AEA30@CEZ.ICE>
In-Reply-To
<7v8xp4196e.fsf@assigned-by-dhcp.cox.net>

On Sun, 14 May 2006 16:24:57 -0700 Junio C Hamano <junkio@cox.net> wrote:

> I do not have problem with that, but somebody else's script
> might; Cogito seems not to mind.
> 
> Something like this perhaps?

That looks good. If you accept the rev-parse patch, then i'd suggest the patch below instead.

Sean
diff --git a/git-tag.sh b/git-tag.sh
index dc6aa95..a0afa25 100755
--- a/git-tag.sh
+++ b/git-tag.sh
@@ -25,14 +25,12 @@ do
 	force=1
 	;;
     -l)
-        cd "$GIT_DIR/refs" &&
 	case "$#" in
 	1)
-		find tags -type f -print ;;
-	*)
-		shift
-		find tags -type f -print | grep "$@" ;;
+		set x . ;;
 	esac
+	shift
+	git rev-parse --symbolic --tags | sort | grep "$@"
 	exit $?
 	;;
     -m)
Previous: Junio C HamanoNext: Jakub Narebski
Message 5 of 6 in “Add "--branches" and "--tags" options to git-rev-parse.”
  1. Add "--branches" and "--tags" options to git-rev-parse.Sean Estabrooks, May 13, 2006
  2. Junio C HamanoMay 13, 2006
  3. Add "--branches", "--tags" and "--remotes" options to git-rev-parse.Sean, May 14, 2006
  4. Junio C HamanoMay 14, 2006
  5. SeanMay 15, 2006
  6. Jakub NarebskiMay 15, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.