{"thread":{"id":"1875","subject":"[PATCH 5/8] cogito: Simplify recursion in cg-object-id.","startedAt":"2005-09-20T02:21:34Z","lastAt":"2005-09-20T02:21:34Z","messageCount":1,"participants":["Pavel Roskin"],"isPatch":true,"patchVersion":1,"patchTotal":8},"messages":[{"id":"8951","messageId":"1127182894.31115.29.camel@dv","threadId":"1875","inReplyTo":null,"subject":"[PATCH 5/8] cogito: Simplify recursion in cg-object-id.","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2005-09-20T02:21:34Z","receivedAt":"2005-09-20T02:21:34Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Simplify recursion in cg-object-id.\n\nIt's not needed to call the whole cg-object-id script from itself.  It's\nsufficient to call normalize_id() from itself.\n\ndiff --git a/cg-object-id b/cg-object-id\n--- a/cg-object-id\n+++ b/cg-object-id\n@@ -32,12 +32,12 @@ normalize_id()\n {\n \tlocal id=\"$1\"\n \n \tif [ \"${id:(-1):1}\" = \"^\" ]; then\n \t\t# find first parent\n-\t\tid=$(cg-object-id \"${id%^}\") || exit 1\n-\t\tnormid=$(git-cat-file commit \"$id\" | \\\n+\t\tnormalize_id \"${id%^}\"\n+\t\tnormid=$(git-cat-file commit \"$normid\" | \\\n \t\t\t awk '/^parent/{print $2; exit};/^$/{exit}') || exit 1\n \t\ttype=\"commit\"\n \t\treturn\n \tfi\n \n\n\n-- \nRegards,\nPavel Roskin\n"}]}