* [PATCH] fetch-pack: avoid packing reachable objects.
@ 2005-10-26 4:26 Jan Harkes
2005-10-26 5:07 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Jan Harkes @ 2005-10-26 4:26 UTC (permalink / raw)
To: git, junkio
Mark remote commits that were found in the alternate repository as
COMPLETE and avoid unnecessary packing of already available objects.
Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu>
---
When we pull updates from a shared repository into a clone that was
created with 'git clone -l -s', we pack objects that are already
reachable. This was because we only marked local refs as COMPLETE.
diff --git a/fetch-pack.c b/fetch-pack.c
index 8566ab1..17524d8 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -169,6 +169,7 @@ static int everything_local(struct ref *
*/
if (o->type == commit_type) {
struct commit *commit = (struct commit *)o;
+ commit->object.flags |= COMPLETE;
if (!cutoff || cutoff < commit->date)
cutoff = commit->date;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] fetch-pack: avoid packing reachable objects.
2005-10-26 4:26 [PATCH] fetch-pack: avoid packing reachable objects Jan Harkes
@ 2005-10-26 5:07 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2005-10-26 5:07 UTC (permalink / raw)
To: Jan Harkes; +Cc: junkio, git
Jan Harkes <jaharkes@cs.cmu.edu> writes:
> Mark remote commits that were found in the alternate repository as
> COMPLETE and avoid unnecessary packing of already available objects.
Sorry, this is wrong (we made this mistake twice already). The
mere existence of that object in the local repository does not
necessarily mean we have everything that is reachable from it.
The rule is that we only trust local refs. Anything that are
reachable from them are known to be complete. And after a
successful fetch, we update local refs. The existence of an
object is a strong _hint_ that it _might_ be complete, but
nothing more.
Think of a case where you tried to fetch via commit walker and
got things reachable from the then-current ref, and the
object you are marking as COMPLETE (maybe in pack) is a remnant
of that failed fetch, which was killed before completing. You
might have complete history starting from the then-current
commit back to that commit, but there is no guarantee that you
can further tangle the history back and find everything needed.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-10-26 5:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-26 4:26 [PATCH] fetch-pack: avoid packing reachable objects Jan Harkes
2005-10-26 5:07 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox