git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: git <git@vger.kernel.org>
Subject: [PATCH 5/8] cogito: Simplify recursion in cg-object-id.
Date: Mon, 19 Sep 2005 22:21:34 -0400	[thread overview]
Message-ID: <1127182894.31115.29.camel@dv> (raw)

Simplify recursion in cg-object-id.

It's not needed to call the whole cg-object-id script from itself.  It's
sufficient to call normalize_id() from itself.

diff --git a/cg-object-id b/cg-object-id
--- a/cg-object-id
+++ b/cg-object-id
@@ -32,12 +32,12 @@ normalize_id()
 {
 	local id="$1"
 
 	if [ "${id:(-1):1}" = "^" ]; then
 		# find first parent
-		id=$(cg-object-id "${id%^}") || exit 1
-		normid=$(git-cat-file commit "$id" | \
+		normalize_id "${id%^}"
+		normid=$(git-cat-file commit "$normid" | \
 			 awk '/^parent/{print $2; exit};/^$/{exit}') || exit 1
 		type="commit"
 		return
 	fi
 


-- 
Regards,
Pavel Roskin

                 reply	other threads:[~2005-09-20  2:21 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=1127182894.31115.29.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).