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
Junio C Hamano <junkio@cox.net>
Date
May 14, 2006, 23:24 UTC
Message-ID
<7v8xp4196e.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<BAYC1-PASMTP043948149786B7EE06DED3AEA20@CEZ.ICE>
Sean <seanlkml@sympatico.ca> writes:
Show 5 quoted lines
> On a related note, would it be okay to change "git tag -l" to
> produce a list of tags without the "tags/" prefix in front of
> every tag as it does now?  Wanted to use the new "git
> rev-parse --tags" instead of "find" to produce the list but am
> not sure how important backward compatibility is in that case.

I do not have problem with that, but somebody else's script might; Cogito seems not to mind.

Something like this perhaps?
-- >8 --
diff --git a/git-tag.sh b/git-tag.sh
index dc6aa95..2286ad5 100755
--- a/git-tag.sh
+++ b/git-tag.sh
@@ -28,11 +28,10 @@ do
         cd "$GIT_DIR/refs" &&
 	case "$#" in
 	1)
-		find tags -type f -print ;;
-	*)
-		shift
-		find tags -type f -print | grep "$@" ;;
+		set x . ;;
 	esac
+	shift
+	find tags -type f -print | sed -e 's|^tags/||' | grep "$@"
 	exit $?
 	;;
     -m)
Previous: SeanNext: Sean
Message 4 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.