{"thread":{"id":"5022","subject":"[PATCH 6/6] merge-recur: Explain why sha_eq() and struct stage_data cannot go","startedAt":"2006-07-27T17:14:17Z","lastAt":"2006-07-27T17:14:17Z","messageCount":1,"participants":["Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"24229","messageId":"Pine.LNX.4.63.0607271913550.29667@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5022","inReplyTo":null,"subject":"[PATCH 6/6] merge-recur: Explain why sha_eq() and struct stage_data cannot go","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-07-27T17:14:17Z","receivedAt":"2006-07-27T17:14:17Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nThere were two TODOs to remove sha_eq() and to convert users of\nstruct stage_data to active_cache users, but this is not possible.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n merge-recursive.c |    9 ++++-----\n 1 files changed, 4 insertions(+), 5 deletions(-)\n\ndiff --git a/merge-recursive.c b/merge-recursive.c\nindex b0f2ecc..cb21bc5 100644\n--- a/merge-recursive.c\n+++ b/merge-recursive.c\n@@ -47,8 +47,8 @@ static struct commit *make_virtual_commi\n }\n \n /*\n- * TODO: we should not have to copy the SHA1s around, but rather reference\n- * them. That way, sha_eq() is just sha1 == sha2.\n+ * Since we use get_tree_entry(), which does not put the read object into\n+ * the object pool, we cannot rely on a == b.\n  */\n static int sha_eq(const unsigned char *a, const unsigned char *b)\n {\n@@ -58,9 +58,8 @@ static int sha_eq(const unsigned char *a\n }\n \n /*\n- * TODO: check if we can just reuse the active_cache structure: it is already\n- * sorted (by name, stage).\n- * Only problem: do not write it when flushing the cache.\n+ * Since we want to write the index eventually, we cannot reuse the index\n+ * for these (temporary) data.\n  */\n struct stage_data\n {\n-- \n1.4.2.rc2.g6a4e\n"}]}