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

Re: [PATCH] make 'git clone' ask the remote only for objects it cares about

From
Shawn O. Pearce <spearce@spearce.org>
Date
Sep 26, 2009, 19:50 UTC
Message-ID
<20090926195039.GG14660@spearce.org>
In-Reply-To
<alpine.LFD.2.00.0909252314260.4997@xanadu.home>
Nicolas Pitre <nico@fluxnic.net> wrote:
Show 7 quoted lines
> Current behavior of 'git clone' when not using --mirror is to fetch 
> everything from the peer, and then filter out unwanted refs just before 
> writing them out to the cloned repository.  This may become highly 
> inefficient if the peer has an unusual ref namespace, or if it simply 
> has "remotes" refs of its own, and those locally unwanted refs are 
> connecting to a large set of objects which becomes unreferenced as soon 
> as they are fetched.
...
> +static void write_remote_refs(const struct ref *local_refs, const char *reflog)
Here reflog is now unused.  I'm going to squash this in.
diff --git a/builtin-clone.c b/builtin-clone.c
index edf7c7f..4992c25 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -342,7 +342,7 @@ static struct ref *wanted_peer_refs(const struct ref *refs,
 	return local_refs;
 }
 
-static void write_remote_refs(const struct ref *local_refs, const char *reflog)
+static void write_remote_refs(const struct ref *local_refs)
 {
 	const struct ref *r;
 
@@ -534,7 +534,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	if (refs) {
 		clear_extra_refs();
 
-		write_remote_refs(mapped_refs, reflog_msg.buf);
+		write_remote_refs(mapped_refs);
 
 		remote_head = find_ref_by_name(refs, "HEAD");
 		remote_head_points_at =
-- 
Shawn.
Previous: Andreas SchwabNext: Nicolas Pitre
Message 16 of 26 in “Re: git gc expanding packed data?”
  1. Andreas SchwabAug 8, 2009
  2. Hin-Tak LeungAug 8, 2009
  3. Andreas SchwabAug 8, 2009
  4. Nicolas PitreAug 9, 2009
  5. Andreas SchwabAug 9, 2009
  6. Jason MerrillSep 25, 2009
  7. Matthieu MoySep 25, 2009
  8. Jason MerrillSep 25, 2009
  9. Nicolas PitreSep 25, 2009
  10. Jason MerrillSep 25, 2009
  11. Nicolas PitreSep 25, 2009
  12. Jason MerrillSep 25, 2009
  13. Nicolas PitreSep 26, 2009
  14. make 'git clone' ask the remote only for objects it cares aboutNicolas Pitre, Sep 26, 2009
  15. Andreas SchwabSep 26, 2009
  16. Shawn O. PearceSep 26, 2009
  17. Nicolas PitreSep 27, 2009
  18. Jason MerrillSep 26, 2009
  19. Jason MerrillSep 26, 2009
  20. Nicolas PitreSep 27, 2009
  21. Nicolas PitreSep 27, 2009
  22. Shawn O. PearceSep 27, 2009
  23. Nicolas PitreSep 27, 2009
  24. Jason MerrillSep 27, 2009
  25. Nicolas PitreSep 28, 2009
  26. Hin-Tak LeungSep 26, 2009

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.