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

Re: [PATCH] tree-walk: convert fill_tree_descriptor() to object_id

From
Johannes Sixt <j6t@kdbg.org>
Date
Aug 12, 2017, 08:04 UTC
Message-ID
<fb99b685-327a-1c01-52d6-f0a1d106544c@kdbg.org>
In-Reply-To
<d1e4b270-4f8b-85e4-b6fd-09657720bed2@web.de>
Am 12.08.2017 um 09:14 schrieb René Scharfe:
Show 6 quoted lines
> -	Initialize a `tree_desc` and decode its first entry given the sha1 of
> -	a tree. Returns the `buffer` member if the sha1 is a valid tree
> -	identifier and NULL otherwise.
> +	Initialize a `tree_desc` and decode its first entry given the
> +	object ID of a tree. Returns the `buffer` member if the sha1 is
> +	a valid tree identifier and NULL otherwise.

There is another mention of "sha1" in the rewritten text. Intended or an oversight?

Show 9 quoted lines
> -#define ENTRY_SHA1(e) (((e)->mode && S_ISDIR((e)->mode)) ? (e)->oid->hash : NULL)
> -	buf0 = fill_tree_descriptor(t+0, ENTRY_SHA1(n + 0));
> -	buf1 = fill_tree_descriptor(t+1, ENTRY_SHA1(n + 1));
> -	buf2 = fill_tree_descriptor(t+2, ENTRY_SHA1(n + 2));
> +#define ENTRY_OID(e) (((e)->mode && S_ISDIR((e)->mode)) ? (e)->oid : NULL)
> +	buf0 = fill_tree_descriptor(t + 0, ENTRY_OID(n + 0));
> +	buf1 = fill_tree_descriptor(t + 1, ENTRY_OID(n + 1));
> +	buf2 = fill_tree_descriptor(t + 2, ENTRY_OID(n + 2));
>   #undef ENTRY_SHA1
This whould be #undef ENTRY_OID.
-- Hannes
Previous: René ScharfeNext: René Scharfe
Message 2 of 4 in “tree-walk: convert fill_tree_descriptor() to object_id”
  1. tree-walk: convert fill_tree_descriptor() to object_idRené Scharfe, Aug 12, 2017
  2. Johannes SixtAug 12, 2017
  3. tree-walk: convert fill_tree_descriptor() to object_idRené Scharfe, Aug 12, 2017
  4. brian m. carlsonAug 12, 2017

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.