git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 5/8] cogito: Simplify recursion in cg-object-id.

From
PRPavel Roskin <proski@gnu.org>
Date
Sep 20, 2005, 02:21 UTC
Message-ID
<1127182894.31115.29.camel@dv>
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
Message 1 of 1 in “cogito: Simplify recursion in cg-object-id.”
  1. 5/8 cogito: Simplify recursion in cg-object-id.Pavel Roskin, Sep 20, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.