{"thread":{"id":"1873","subject":"[PATCH 3/8] cogito: \"cg-object-id -p\" should separate its output by newlines","startedAt":"2005-09-20T02:14:56Z","lastAt":"2005-09-20T02:14:56Z","messageCount":1,"participants":["Pavel Roskin"],"isPatch":true,"patchVersion":1,"patchTotal":8},"messages":[{"id":"8949","messageId":"1127182496.31115.21.camel@dv","threadId":"1873","inReplyTo":null,"subject":"[PATCH 3/8] cogito: \"cg-object-id -p\" should separate its output by newlines","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2005-09-20T02:14:56Z","receivedAt":"2005-09-20T02:14:56Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"\"cg-object-id -p\" should separate its output by newlines.\n\nIf there are several parents, they should be separated by newlines, not\nby spaces.  That's what cg-diff expects.\n\ndiff --git a/cg-Xnormid b/cg-Xnormid\n--- a/cg-Xnormid\n+++ b/cg-Xnormid\n@@ -17,11 +17,11 @@\n id=\"$1\"\n \n if [ \"${id:(-1):1}\" = \"^\" ]; then\n \t# find parent\n \tid=$(cg-object-id \"${id%^}\") || exit 1\n-\tgit-cat-file commit \"$id\" | awk '/^parent/{print $2,\" \"};/^$/{exit}' || exit 1\n+\tgit-cat-file commit \"$id\" | awk '/^parent/{print $2};/^$/{exit}' || exit 1\n \texit\n fi\n \n if [ ! \"$id\" ] || [ \"$id\" = \"this\" ] || [ \"$id\" = \"HEAD\" ]; then\n \tread id < \"$_git/HEAD\"\ndiff --git a/cg-object-id b/cg-object-id\n--- a/cg-object-id\n+++ b/cg-object-id\n@@ -9,12 +9,12 @@\n #\n # OPTIONS\n # -------\n # -p::\n #\tGet ID of parent commit(s) to a given revision or HEAD.\n-#\tNOTE: Multiple SHA1s will be returned for commits with multiple\n-#\tparents.\n+#\tNOTE: Multiple SHA1s separated by newlines will be returned for\n+#\tcommits with multiple parents.\n #\n # -t::\n #\tGet ID of tree associated with given commit or HEAD.\n #\n # OBJECT_ID::\n@@ -53,11 +53,11 @@ if [ \"$show_parent\" ]; then\n fi\n \n normid=$(. ${COGITO_LIB}cg-Xnormid \"$id\") || exit 1\n \n if [ \"$show_parent\" ]; then\n-\techo ${normid% *}\n+\techo \"${normid% *}\"\n \texit 0\n fi\n \n type=${normid#* }\n normid=${normid% *}\n\n\n\n-- \nRegards,\nPavel Roskin\n"}]}