aboutsummaryrefslogtreecommitdiff
path: root/git-tag.sh
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-06-30 02:42:47 -0400
committerJunio C Hamano <gitster@pobox.com>2007-06-30 00:00:30 -0700
commitbfc04bb9b847912ee41a21fc23110962851878b2 (patch)
tree4f55608848764038be2a8e6e454a66d73448074b /git-tag.sh
parent124d3e4cacdf018ddad3449919f471a624e85433 (diff)
downloadgit-bfc04bb9b847912ee41a21fc23110962851878b2.tar.gz
git-bfc04bb9b847912ee41a21fc23110962851878b2.tar.xz
Correct usages of sed in git-tag for Mac OS X
Both `git-tag -l` and `git tag -v` fail on Mac OS X due to their non-standard uses of sed. Actually `git tag -v` fails because the underlying git-tag-verify uses a non-standard sed command. We now stick to only standard sed, which does make our sed scripts slightly more complicated, but we can actually list tags with more than 0 lines of additional context and we can verify signed tags with gpg. These major Git functions are much more important than saving two or three lines of a simple sed script. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-tag.sh')
-rwxr-xr-xgit-tag.sh16
1 files changed, 10 insertions, 6 deletions
diff --git a/git-tag.sh b/git-tag.sh
index c84043902..3917cd829 100755
--- a/git-tag.sh
+++ b/git-tag.sh
@@ -51,12 +51,16 @@ do
[ "$LINES" -le 0 ] && { echo "$TAG"; continue ;}
OBJTYPE=$(git cat-file -t "$TAG")
case $OBJTYPE in
- tag) ANNOTATION=$(git cat-file tag "$TAG" |
- sed -e '1,/^$/d' \
- -e '/^-----BEGIN PGP SIGNATURE-----$/Q' )
- printf "%-15s %s\n" "$TAG" "$ANNOTATION" |
- sed -e '2,$s/^/ /' \
- -e "${LINES}q"
+ tag)
+ ANNOTATION=$(git cat-file tag "$TAG" |
+ sed -e '1,/^$/d' |
+ sed -n -e "
+ /^-----BEGIN PGP SIGNATURE-----\$/q
+ 2,\$s/^/ /
+ p
+ ${LINES}q
+ ")
+ printf "%-15s %s\n" "$TAG" "$ANNOTATION"
;;
*) echo "$TAG"
;;