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

[PATCH 18/39] pack: add repository argument to prepare_packed_git_one

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 30, 2017, 07:03 UTC
Message-ID
<20170830070329.GS153983@aiede.mtv.corp.google.com>
In-Reply-To
<20170830064634.GA153983@aiede.mtv.corp.google.com>

Add a repository argument to allow the prepare_packed_git_one caller to be more specific about which repository to handle. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet.

As with the previous commits, use a macro to catch callers passing a repository other than the_repository at compile time.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 packfile.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/packfile.c b/packfile.c
index cea3698af5..3a841c0f69 100644
--- a/packfile.c
+++ b/packfile.c
@@ -719,7 +719,8 @@ static void report_pack_garbage(struct string_list *list)
 	report_helper(list, seen_bits, first, list->nr);
 }
 
-static void prepare_packed_git_one(char *objdir, int local)
+#define prepare_packed_git_one(r, o, l) prepare_packed_git_one_##r(o, l)
+static void prepare_packed_git_one_the_repository(char *objdir, int local)
 {
 	struct strbuf path = STRBUF_INIT;
 	size_t dirnamelen;
@@ -871,10 +872,10 @@ void prepare_packed_git(void)
 
 	if (the_repository->objects.packed_git_initialized)
 		return;
-	prepare_packed_git_one(get_object_directory(), 1);
+	prepare_packed_git_one(the_repository, get_object_directory(), 1);
 	prepare_alt_odb(the_repository);
 	for (alt = the_repository->objects.alt_odb_list; alt; alt = alt->next)
-		prepare_packed_git_one(alt->path, 0);
+		prepare_packed_git_one(the_repository, alt->path, 0);
 	rearrange_packed_git();
 	prepare_packed_git_mru();
 	the_repository->objects.packed_git_initialized = 1;
-- 
2.14.1.581.gf28d330327
Previous: Jonathan NiederNext: Jonathan Nieder
Message 22 of 46 in “per-repository object store, part 1”
  1. 00/39 per-repository object store, part 1Jonathan Nieder, Aug 30, 2017
  2. 01/39 pack: make packed_git_mru global a value instead of a pointerJonathan Nieder, Aug 30, 2017
  3. Jeff KingAug 30, 2017
  4. Junio C HamanoSep 6, 2017
  5. 02/39 repository: introduce object store fieldJonathan Nieder, Aug 30, 2017
  6. 03/39 object-store: move alt_odb_list and alt_odb_tail to object storeJonathan Nieder, Aug 30, 2017
  7. 04/39 object-store: move packed_git and packed_git_mru to object storeJonathan Nieder, Aug 30, 2017
  8. 05/39 pack: move prepare_packed_git_run_once to object storeJonathan Nieder, Aug 30, 2017
  9. 06/39 pack: move approximate object count to object storeJonathan Nieder, Aug 30, 2017
  10. 07/39 sha1_file: add repository argument to alt_odb_usableJonathan Nieder, Aug 30, 2017
  11. Brandon WilliamsAug 30, 2017
  12. 08/39 sha1_file: add repository argument to link_alt_odb_entryJonathan Nieder, Aug 30, 2017
  13. 09/39 sha1_file: add repository argument to read_info_alternatesJonathan Nieder, Aug 30, 2017
  14. 10/39 sha1_file: add repository argument to link_alt_odb_entriesJonathan Nieder, Aug 30, 2017
  15. 11/39 sha1_file: add repository argument to stat_sha1_fileJonathan Nieder, Aug 30, 2017
  16. 12/39 sha1_file: add repository argument to open_sha1_fileJonathan Nieder, Aug 30, 2017
  17. 13/39 sha1_file: add repository argument to map_sha1_file_1Jonathan Nieder, Aug 30, 2017
  18. 14/39 sha1_file: add repository argument to sha1_loose_object_infoJonathan Nieder, Aug 30, 2017
  19. 15/39 object-store: add repository argument to prepare_alt_odbJonathan Nieder, Aug 30, 2017
  20. 16/39 object-store: add repository argument to foreach_alt_odbJonathan Nieder, Aug 30, 2017
  21. 17/39 pack: add repository argument to install_packed_gitJonathan Nieder, Aug 30, 2017
  22. 18/39 pack: add repository argument to prepare_packed_git_oneJonathan Nieder, Aug 30, 2017
  23. 19/39 pack: add repository argument to rearrange_packed_gitJonathan Nieder, Aug 30, 2017
  24. 20/39 pack: add repository argument to prepare_packed_git_mruJonathan Nieder, Aug 30, 2017
  25. 21/39 pack: add repository argument to prepare_packed_gitJonathan Nieder, Aug 30, 2017
  26. 22/39 pack: add repository argument to reprepare_packed_gitJonathan Nieder, Aug 30, 2017
  27. 23/39 pack: add repository argument to sha1_file_nameJonathan Nieder, Aug 30, 2017
  28. 24/39 pack: add repository argument to map_sha1_fileJonathan Nieder, Aug 30, 2017
  29. 25/39 sha1_file: allow alt_odb_usable to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  30. Junio C HamanoSep 6, 2017
  31. Stefan BellerSep 6, 2017
  32. 26/39 object-store: allow prepare_alt_odb to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  33. 27/39 object-store: allow foreach_alt_odb to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  34. 28/39 pack: allow install_packed_git to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  35. 29/39 pack: allow rearrange_packed_git to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  36. 30/39 pack: allow prepare_packed_git_mru to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  37. 31/39 pack: allow prepare_packed_git_one to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  38. 32/39 pack: allow prepare_packed_git to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  39. 33/39 pack: allow reprepare_packed_git to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  40. 34/39 pack: allow sha1_file_name to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  41. 35/39 pack: allow stat_sha1_file to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  42. 36/39 pack: allow open_sha1_file to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  43. 37/39 pack: allow map_sha1_file_1 to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  44. 38/39 pack: allow map_sha1_file to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  45. 39/39 pack: allow sha1_loose_object_info to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  46. Brandon WilliamsAug 30, 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.