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

[RFC PATCH 02/10] packfile: expose get_delta_base()

From
Christian Couder <christian.couder@gmail.com>
Date
Sep 13, 2019, 13:02 UTC
Message-ID
<20190913130226.7449-3-chriscool@tuxfamily.org>
In-Reply-To
<20190913130226.7449-1-chriscool@tuxfamily.org>
From: Jeff King <peff@peff.net>

In a following commit get_delta_base() will be used outside packfile.c, so let's make it non static and declare it in packfile.h.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 packfile.c | 10 +++++-----
 packfile.h |  3 +++
 2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/packfile.c b/packfile.c
index fc43a6c52c..5a6e8d54f1 100644
--- a/packfile.c
+++ b/packfile.c
@@ -1191,11 +1191,11 @@ const struct packed_git *has_packed_and_bad(struct repository *r,
 	return NULL;
 }
 
-static off_t get_delta_base(struct packed_git *p,
-				    struct pack_window **w_curs,
-				    off_t *curpos,
-				    enum object_type type,
-				    off_t delta_obj_offset)
+off_t get_delta_base(struct packed_git *p,
+		     struct pack_window **w_curs,
+		     off_t *curpos,
+		     enum object_type type,
+		     off_t delta_obj_offset)
 {
 	unsigned char *base_info = use_pack(p, w_curs, *curpos, NULL);
 	off_t base_offset;
diff --git a/packfile.h b/packfile.h
index 3e98910bdd..8049202f4c 100644
--- a/packfile.h
+++ b/packfile.h
@@ -151,6 +151,9 @@ void *unpack_entry(struct repository *r, struct packed_git *, off_t, enum object
 unsigned long unpack_object_header_buffer(const unsigned char *buf, unsigned long len, enum object_type *type, unsigned long *sizep);
 unsigned long get_size_from_delta(struct packed_git *, struct pack_window **, off_t);
 int unpack_object_header(struct packed_git *, struct pack_window **, off_t *, unsigned long *);
+off_t get_delta_base(struct packed_git *p, struct pack_window **w_curs,
+		     off_t *curpos, enum object_type type,
+		     off_t delta_obj_offset);
 
 void release_pack_memory(size_t);
 
-- 
2.23.0.46.gd213b4aca1.dirty
Previous: Christian CouderNext: Christian Couder
Message 3 of 31 in “Rewrite packfile reuse code”
  1. 00/10 Rewrite packfile reuse codeChristian Couder, Sep 13, 2019
  2. 01/10 builtin/pack-objects: report reused packfile objectsChristian Couder, Sep 13, 2019
  3. 02/10 packfile: expose get_delta_base()Christian Couder, Sep 13, 2019
  4. 06/10 pack-bitmap: introduce bitmap_walk_contains()Christian Couder, Sep 13, 2019
  5. 04/10 ewah/bitmap: always allocate 2 more wordsChristian Couder, Sep 13, 2019
  6. Jonathan TanOct 10, 2019
  7. Christian CouderOct 11, 2019
  8. Jeff KingOct 11, 2019
  9. 07/10 csum-file: introduce hashfile_total()Christian Couder, Sep 13, 2019
  10. 08/10 pack-objects: introduce pack.allowPackReuseChristian Couder, Sep 13, 2019
  11. Junio C HamanoSep 13, 2019
  12. 03/10 ewah/bitmap: introduce bitmap_word_alloc()Christian Couder, Sep 13, 2019
  13. 05/10 pack-bitmap: don't rely on bitmap_git->reuse_objectsChristian Couder, Sep 13, 2019
  14. Jonathan TanOct 10, 2019
  15. Christian CouderOct 11, 2019
  16. 10/10 pack-objects: improve partial packfile reuseChristian Couder, Sep 13, 2019
  17. Junio C HamanoSep 13, 2019
  18. Jeff KingSep 14, 2019
  19. Junio C HamanoSep 14, 2019
  20. Jeff KingOct 2, 2019
  21. Junio C HamanoOct 3, 2019
  22. Christian CouderOct 3, 2019
  23. Jonathan TanOct 10, 2019
  24. Christian CouderOct 11, 2019
  25. Jeff KingOct 11, 2019
  26. Jonathan TanOct 11, 2019
  27. Junio C HamanoOct 12, 2019
  28. Jeff KingOct 13, 2019
  29. Junio C HamanoOct 17, 2019
  30. Jeff KingOct 17, 2019
  31. 09/10 builtin/pack-objects: introduce obj_is_packed()Christian Couder, Sep 13, 2019

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.