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

[PATCH] git-bundle: fix pack generation.

From
Junio C Hamano <junkio@cox.net>
Date
Mar 6, 2007, 07:45 UTC
Message-ID
<7vejo2stlw.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<45ECEB40.4000907@gmail.com>

The handcrafted built-in rev-list lookalike forgot to mark the trees and blobs contained in the boundary commits uninteresting, resulting in unnecessary objects in the pack.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 * I'll have this in 'master' tonight.  Also I am thinking about
   changing 'git bundle verify' to spit out heads and prereqs
   unconditionally, in addition to 'foo.bdl is ok'.  Comments?
 builtin-bundle.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/builtin-bundle.c b/builtin-bundle.c
index d41a413..279b8f8 100644
--- a/builtin-bundle.c
+++ b/builtin-bundle.c
@@ -263,6 +263,11 @@ static void show_object(struct object_array_entry *p)
 	write_or_die(1, "\n", 1);
 }
 
+static void show_edge(struct commit *commit)
+{
+	; /* nothing to do */
+}
+
 static int create_bundle(struct bundle_header *header, const char *path,
 		int argc, const char **argv)
 {
@@ -341,6 +346,7 @@ static int create_bundle(struct bundle_header *header, const char *path,
 	dup2(in, 1);
 	close(in);
 	prepare_revision_walk(&revs);
+	mark_edges_uninteresting(revs.commits, &revs, show_edge);
 	traverse_commit_list(&revs, show_commit, show_object);
 	close(1);
 	while (waitpid(pid, &status, 0) < 0)
-- 
1.5.0.3.862.g71037
Previous: Junio C HamanoNext: Mark Levedahl
Message 3 of 22 in “builtin git-bundle - pack contains many more objects than required”
  1. Mark LevedahlMar 6, 2007
  2. Junio C HamanoMar 6, 2007
  3. git-bundle: fix pack generation.Junio C Hamano, Mar 6, 2007
  4. Mark LevedahlMar 7, 2007
  5. Junio C HamanoMar 7, 2007
  6. Mark LevedahlMar 7, 2007
  7. Johannes SchindelinMar 7, 2007
  8. Mark LevedahlMar 7, 2007
  9. Johannes SchindelinMar 7, 2007
  10. Junio C HamanoMar 7, 2007
  11. Mark LevedahlMar 7, 2007
  12. Johannes SchindelinMar 7, 2007
  13. Linus TorvaldsMar 7, 2007
  14. git-bundle: Make thin packsJohannes Schindelin, Mar 8, 2007
  15. Linus TorvaldsMar 8, 2007
  16. Johannes SchindelinMar 8, 2007
  17. Junio C HamanoMar 8, 2007
  18. Johannes SchindelinMar 8, 2007
  19. Junio C HamanoMar 7, 2007
  20. git-bundle: avoid packing objects which are in the prerequisitesJohannes Schindelin, Mar 7, 2007
  21. Mark LevedahlMar 8, 2007
  22. Mark LevedahlMar 7, 2007

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.