{"thread":{"id":"6934","subject":"[COGITO] fix git-tag-ls in the presence of all-packed tags","startedAt":"2007-02-24T00:07:13Z","lastAt":"2007-02-24T00:07:13Z","messageCount":1,"participants":["Nix"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"35354","messageId":"87abz4e7v2.fsf@hades.wkstn.nix","threadId":"6934","inReplyTo":null,"subject":"[COGITO] fix git-tag-ls in the presence of all-packed tags","fromName":"Nix","fromEmail":"nix@esperi.org.uk","sentAt":"2007-02-24T00:07:13Z","receivedAt":"2007-02-24T00:07:13Z","isPatch":false,"sender":{"key":"nix@esperi.org.uk","avatar":"https://avatars.githubusercontent.com/u/6503005?v=4"},"body":"(I don't know if cogito is dead (no changes for two months), but on the\noff-chance that it isn't here's a tiny patch.)\n\n\nRely on the ref walker to determine if there are any tags.\n(Just consulting refs/tags fails wrongly if all tags are packed.)\n\nSigned-off-by: Nick Alcock <nix@esperi.org.uk>\n\ndiff --git a/cg-tag-ls b/cg-tag-ls\nindex f4c776c..724f428 100755\n--- a/cg-tag-ls\n+++ b/cg-tag-ls\n@@ -28,10 +28,7 @@ _git_wc_unneeded=1\n \n msg_no_tags=\"no tags present, please see cg-tag(1)\"\n \n-[ -d \"$_git/refs/tags\" ] || die \"$msg_no_tags\"\n-\n-[ \"$(find \"$_git/refs/tags\" -follow -type f)\" ] \\\n-       || die \"$msg_no_tags\"\n+[ \"x$(git-for-each-ref --count=1 --format=present refs/tags)\" = \"xpresent\" ] || die \"$msg_no_tags\"\n \n maxlen=\"$(git-for-each-ref --format=\"%(refname)\" refs/tags | column_width \"refs/tags/\")\"\n \n\n-- \n`In the future, company names will be a 32-character hex string.'\n  --- Bruce Schneier on the shortage of company names\n"}]}