Thread (6 messages) flat view 6 messages, 2 authors, 2016-06-15

Re: [PATCH] fetch-pack should not ask for a ref which is already there

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:07


On Thu, 29 Sep 2005, Johannes Schindelin wrote:
With this patch, instead of blindly asking for every remote ref, fetch-pack
first looks in the local repository if that ref is already there.
No. This is WRONG.

It may seem like a sane thing to do, but it is very very horribly broken.

The fact is, if an earlier fetch was interrupted, or if you've used things
like rsync, you may have disconnected objects in your object store. The 
fact that you have a particular commit object is _not_ a guarantee that 
you have everything that leads up to it.

The "fetch" semantics are simple: we only write out new refs _after_ we've 
fetched all the objects that point to them. That means that while we 
cannot trust a "oh, I already have this commit, let's skip it", we _can_ 
trust "oh, I already have these refs, let's skip them".

So please do _not_ add logic like this to git-fetch. I'd _much_ rather
fetch some objects twice than end up with a corrupt repository.

		Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help