From: Nix <nix@esperi.org.uk>
To: git@vger.kernel.org, Petr Baudis <pasky@suse.cz>
Subject: [COGITO] fix git-tag-ls in the presence of all-packed tags
Date: Sat, 24 Feb 2007 00:07:13 +0000 [thread overview]
Message-ID: <87abz4e7v2.fsf@hades.wkstn.nix> (raw)
(I don't know if cogito is dead (no changes for two months), but on the
off-chance that it isn't here's a tiny patch.)
Rely on the ref walker to determine if there are any tags.
(Just consulting refs/tags fails wrongly if all tags are packed.)
Signed-off-by: Nick Alcock <nix@esperi.org.uk>
diff --git a/cg-tag-ls b/cg-tag-ls
index f4c776c..724f428 100755
--- a/cg-tag-ls
+++ b/cg-tag-ls
@@ -28,10 +28,7 @@ _git_wc_unneeded=1
msg_no_tags="no tags present, please see cg-tag(1)"
-[ -d "$_git/refs/tags" ] || die "$msg_no_tags"
-
-[ "$(find "$_git/refs/tags" -follow -type f)" ] \
- || die "$msg_no_tags"
+[ "x$(git-for-each-ref --count=1 --format=present refs/tags)" = "xpresent" ] || die "$msg_no_tags"
maxlen="$(git-for-each-ref --format="%(refname)" refs/tags | column_width "refs/tags/")"
--
`In the future, company names will be a 32-character hex string.'
--- Bruce Schneier on the shortage of company names
reply other threads:[~2007-02-24 0:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87abz4e7v2.fsf@hades.wkstn.nix \
--to=nix@esperi.org.uk \
--cc=git@vger.kernel.org \
--cc=pasky@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).