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

[PATCH 1/5] Declare lookup_replace_object() in cache.h, not in commit.h

From
Junio C Hamano <gitster@pobox.com>
Date
May 15, 2011, 19:54 UTC
Message-ID
<1305489294-14341-2-git-send-email-gitster@pobox.com>
In-Reply-To
<1305489294-14341-1-git-send-email-gitster@pobox.com>

The declaration is misplaced as the replace API is supposed to affect not just commits, but all types of objects.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 cache.h  |    1 +
 commit.h |    2 --
 2 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/cache.h b/cache.h
index 2b34116..e09cf75 100644
--- a/cache.h
+++ b/cache.h
@@ -763,6 +763,7 @@ static inline void *read_sha1_file(const unsigned char *sha1, enum object_type *
 {
 	return read_sha1_file_repl(sha1, type, size, NULL);
 }
+extern const unsigned char *lookup_replace_object(const unsigned char *sha1);
 extern int hash_sha1_file(const void *buf, unsigned long len, const char *type, unsigned char *sha1);
 extern int write_sha1_file(const void *buf, unsigned long len, const char *type, unsigned char *return_sha1);
 extern int pretend_sha1_file(void *, unsigned long, enum object_type, unsigned char *);
diff --git a/commit.h b/commit.h
index b3c3bb7..f251e75 100644
--- a/commit.h
+++ b/commit.h
@@ -145,8 +145,6 @@ struct commit_graft *read_graft_line(char *buf, int len);
 int register_commit_graft(struct commit_graft *, int);
 struct commit_graft *lookup_commit_graft(const unsigned char *sha1);
 
-const unsigned char *lookup_replace_object(const unsigned char *sha1);
-
 extern struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2, int cleanup);
 extern struct commit_list *get_merge_bases_many(struct commit *one, int n, struct commit **twos, int cleanup);
 extern struct commit_list *get_octopus_merge_bases(struct commit_list *in);
-- 
1.7.5.1.334.gdfd07
Previous: Junio C HamanoNext: Junio C Hamano
Message 2 of 6 in “Updates to replace-object API”
  1. 0/5 Updates to replace-object APIJunio C Hamano, May 15, 2011
  2. 1/5 Declare lookup_replace_object() in cache.h, not in commit.hJunio C Hamano, May 15, 2011
  3. 2/5 t6050: make sure we test not just commit replacementJunio C Hamano, May 15, 2011
  4. 3/5 read_sha1_file(): get rid of read_sha1_file_repl() madnessJunio C Hamano, May 15, 2011
  5. 4/5 inline lookup_replace_object() callsJunio C Hamano, May 15, 2011
  6. 5/5 read_sha1_file(): allow selective bypassing of replacement mechanismJunio C Hamano, May 15, 2011

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.