{"thread":{"id":"1547","subject":"[PATCH] commit-id, tree-id fail on tags","startedAt":"2005-08-17T04:27:38Z","lastAt":"2005-08-17T04:27:38Z","messageCount":1,"participants":["Pavel Roskin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"7417","messageId":"1124252858.26240.31.camel@dv","threadId":"1547","inReplyTo":null,"subject":"[PATCH] commit-id, tree-id fail on tags","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2005-08-17T04:27:38Z","receivedAt":"2005-08-17T04:27:38Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hello!\n\nTag names don't work with current cogito because commit-id and tree-id\ndon't parse the cg-Xnormid output properly.\n\nNamely, if $type is empty (which is the case for tags), $normid is used\nbefore the trailing space is stripped from it.\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n\ndiff --git a/commit-id b/commit-id\n--- a/commit-id\n+++ b/commit-id\n@@ -9,8 +9,9 @@\n \n id=\"$1\"\n normid=$(. ${COGITO_LIB}cg-Xnormid \"$id\") || exit 1\n-type=${normid#* }; [ \"$type\" ] || type=$(git-cat-file -t \"$normid\")\n+type=${normid#* }\n normid=${normid% *}\n+[ \"$type\" ] || type=$(git-cat-file -t \"$normid\")\n \n if [ \"$type\" != \"commit\" ]; then\n \techo \"Invalid commit id: $normid\" >&2\ndiff --git a/tree-id b/tree-id\n--- a/tree-id\n+++ b/tree-id\n@@ -7,8 +7,9 @@\n \n id=\"$1\"\n normid=$(. ${COGITO_LIB}cg-Xnormid \"$id\") || exit 1\n-type=${normid#* }; [ \"$type\" ] || type=$(git-cat-file -t \"$normid\")\n+type=${normid#* }\n normid=${normid% *}\n+[ \"$type\" ] || type=$(git-cat-file -t \"$normid\")\n \n if [ \"$type\" = \"commit\" ]; then\n \tnormid=$(git-cat-file commit \"$normid\" | sed -e 's/tree //;q')\n\n\n-- \nRegards,\nPavel Roskin\n"}]}