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

[PATCH 6/6] merge-recur: Explain why sha_eq() and struct stage_data cannot go

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 27, 2006, 17:14 UTC
Message-ID
<Pine.LNX.4.63.0607271913550.29667@wbgn013.biozentrum.uni-wuerzburg.de>

There were two TODOs to remove sha_eq() and to convert users of struct stage_data to active_cache users, but this is not possible.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 merge-recursive.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index b0f2ecc..cb21bc5 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -47,8 +47,8 @@ static struct commit *make_virtual_commi
 }
 
 /*
- * TODO: we should not have to copy the SHA1s around, but rather reference
- * them. That way, sha_eq() is just sha1 == sha2.
+ * Since we use get_tree_entry(), which does not put the read object into
+ * the object pool, we cannot rely on a == b.
  */
 static int sha_eq(const unsigned char *a, const unsigned char *b)
 {
@@ -58,9 +58,8 @@ static int sha_eq(const unsigned char *a
 }
 
 /*
- * TODO: check if we can just reuse the active_cache structure: it is already
- * sorted (by name, stage).
- * Only problem: do not write it when flushing the cache.
+ * Since we want to write the index eventually, we cannot reuse the index
+ * for these (temporary) data.
  */
 struct stage_data
 {
-- 
1.4.2.rc2.g6a4e
Message 1 of 1 in “merge-recur: Explain why sha_eq() and struct stage_data cannot go”
  1. 6/6 merge-recur: Explain why sha_eq() and struct stage_data cannot goJohannes Schindelin, Jul 27, 2006

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.