From: Junio C Hamano Date: Sun, 14 May 2006 23:24:57 GMT Subject: Re: [PATCH] Add "--branches", "--tags" and "--remotes" options to git-rev-parse. Message-ID: <7v8xp4196e.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Sean writes: > 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)