Re: [PATCH 0/5] not making corruption worse

2015-03-18 Thread Jeff King
On Tue, Mar 17, 2015 at 03:54:02PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > But it strikes me as weird that we consider the _tips_ of history to be > > special for ignoring breakage. If the tip of "bar" is broken, we omit > > it. But if the tip is fine, and there's breakage three c

Re: [PATCH 0/5] not making corruption worse

2015-03-17 Thread Junio C Hamano
Jeff King writes: > But it strikes me as weird that we consider the _tips_ of history to be > special for ignoring breakage. If the tip of "bar" is broken, we omit > it. But if the tip is fine, and there's breakage three commits down in > the history, then doing a clone is going to fail horribly,

Re: [PATCH 0/5] not making corruption worse

2015-03-17 Thread Jeff King
On Tue, Mar 17, 2015 at 03:27:50AM -0400, Jeff King wrote: > The general strategy for these is to use for_each_rawref traversals in > these situations. That doesn't cover _every_ possible scenario. For > example, you could do: > > git clone --no-local repo.git backup.git && > rm -rf repo.git

[PATCH 0/5] not making corruption worse

2015-03-17 Thread Jeff King
This is a grab bag of fixes related to performing destructive operations in a repository with minor corruption. Of course we hope never to see corruption in the first place, but I think if we do see it, we should err on the side of not making things worse. IOW, it is better to abort and say "fix th