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

[PATCH 2/2] pack-objects: change the name of add_objects_in_unpacked_packs

From
DRDamien Robert <damien.olivier.robert@gmail.com>
Date
Feb 28, 2020, 15:43 UTC
Message-ID
<20200228154357.1710521-3-damien.olivier.robert+git@gmail.com>
In-Reply-To
<20200228154357.1710521-1-damien.olivier.robert+git@gmail.com>

`add_objects_in_unpacked_packs` was added in commit 08cdfb13374f31b0c1c47444f55042e7b72c3190 (Sep 2007) to handle the `--keep-unreachable` option.

Back then this function would iterate through packs associated to a list of revs, and add all objects that was not already in the object list, hence the name.

Now the function simply iterate through all packs (more precisely all local packs not marked as .keep), and add all objects not already in the object list.

So rename the function to add_unreachable_packed_objects, to mimic the naming of add_unreachable_loose_objects.

Signed-off-by: Damien Robert <damien.olivier.robert+git@gmail.com>
---
 builtin/pack-objects.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 940fbcb7b3..16c2efdbec 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -3031,7 +3031,7 @@ static int ofscmp(const void *a_, const void *b_)
 		return oidcmp(&a->object->oid, &b->object->oid);
 }
 
-static void add_objects_in_unpacked_packs(void)
+static void add_unreachable_packed_objects(void)
 {
 	struct packed_git *p;
 	struct in_pack in_pack;
@@ -3290,7 +3290,7 @@ static void get_object_list(int ac, const char **av)
 	}
 
 	if (keep_unreachable)
-		add_objects_in_unpacked_packs();
+		add_unreachable_packed_objects();
 	if (pack_loose_unreachable)
 		add_unreachable_loose_objects();
 	if (unpack_unreachable)
-- 
Patched on top of v2.25.1-377-g2d2118b814 (git version 2.25.1)
Previous: Junio C HamanoNext: Damien Robert
Message 14 of 15 in “Documentation of pack and repack”
  1. 0/2 Documentation of pack and repackDamien Robert, Feb 28, 2020
  2. 1/2 doc: update the documentation of pack-objects and repackDamien Robert, Feb 28, 2020
  3. Junio C HamanoMar 2, 2020
  4. Damien RobertMar 3, 2020
  5. Junio C HamanoMar 3, 2020
  6. Damien RobertMar 3, 2020
  7. Junio C HamanoMar 3, 2020
  8. 0/3 Documentation of pack and repackDamien Robert, Mar 12, 2020
  9. 1/3 pack-objects: change the name of add_objects_in_unpacked_packsDamien Robert, Mar 12, 2020
  10. 2/3 doc: update the documentation of pack-objects and repackDamien Robert, Mar 12, 2020
  11. 3/3 doc: add a short explanation for git-repack optionsDamien Robert, Mar 12, 2020
  12. Damien RobertMar 25, 2020
  13. Junio C HamanoMar 27, 2020
  14. 2/2 pack-objects: change the name of add_objects_in_unpacked_packsDamien Robert, Feb 28, 2020
  15. Damien RobertFeb 28, 2020

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.