From: Pavel Roskin <proski@gnu.org>
To: git <git@vger.kernel.org>
Subject: [PATCH 3/8] cogito: "cg-object-id -p" should separate its output by newlines
Date: Mon, 19 Sep 2005 22:14:56 -0400 [thread overview]
Message-ID: <1127182496.31115.21.camel@dv> (raw)
"cg-object-id -p" should separate its output by newlines.
If there are several parents, they should be separated by newlines, not
by spaces. That's what cg-diff expects.
diff --git a/cg-Xnormid b/cg-Xnormid
--- a/cg-Xnormid
+++ b/cg-Xnormid
@@ -17,11 +17,11 @@
id="$1"
if [ "${id:(-1):1}" = "^" ]; then
# find parent
id=$(cg-object-id "${id%^}") || exit 1
- git-cat-file commit "$id" | awk '/^parent/{print $2," "};/^$/{exit}' || exit 1
+ git-cat-file commit "$id" | awk '/^parent/{print $2};/^$/{exit}' || exit 1
exit
fi
if [ ! "$id" ] || [ "$id" = "this" ] || [ "$id" = "HEAD" ]; then
read id < "$_git/HEAD"
diff --git a/cg-object-id b/cg-object-id
--- a/cg-object-id
+++ b/cg-object-id
@@ -9,12 +9,12 @@
#
# OPTIONS
# -------
# -p::
# Get ID of parent commit(s) to a given revision or HEAD.
-# NOTE: Multiple SHA1s will be returned for commits with multiple
-# parents.
+# NOTE: Multiple SHA1s separated by newlines will be returned for
+# commits with multiple parents.
#
# -t::
# Get ID of tree associated with given commit or HEAD.
#
# OBJECT_ID::
@@ -53,11 +53,11 @@ if [ "$show_parent" ]; then
fi
normid=$(. ${COGITO_LIB}cg-Xnormid "$id") || exit 1
if [ "$show_parent" ]; then
- echo ${normid% *}
+ echo "${normid% *}"
exit 0
fi
type=${normid#* }
normid=${normid% *}
--
Regards,
Pavel Roskin
reply other threads:[~2005-09-20 2:15 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=1127182496.31115.21.camel@dv \
--to=proski@gnu.org \
--cc=git@vger.kernel.org \
/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).