Re: smudge filters during checkout & crash consistency

2014-11-12 Thread Junio C Hamano
Derek Moore writes: >> But if you then switch to B from that state, F will not even be >> modified (i.e. it will keep the contents you prepared for "branch >> A's instance of F"). > > Or: the post-commit hook used in the workaround looks up the prior > branch via @{-1}, finds all files common bet

Re: smudge filters during checkout & crash consistency

2014-11-12 Thread Derek Moore
> But if you then switch to B from that state, F will not even be > modified (i.e. it will keep the contents you prepared for "branch > A's instance of F"). Or: the post-commit hook used in the workaround looks up the prior branch via @{-1}, finds all files common between @ & @{-1} that don't shar

Re: smudge filters during checkout & crash consistency

2014-11-12 Thread Derek Moore
Here's a solution that depends only/mostly on blob contents: 1) construct the ident of the blob via an `(echo -e -n "blob \0" ; cat file) | sha1sum` equivalent if an $Id$ string is not found in its contents, 2) look up the earliest commit with that blob hash at that path, and 3) use the reflog m

Re: smudge filters during checkout & crash consistency

2014-11-12 Thread Junio C Hamano
Derek Moore writes: > I have a case where I would like to smudge files according to the > reflog information of the switching-to branch. Don't do that. When you have branches A, B and C, and a path F is the same between branches A and B but different in branch C, if you start from branch C and

smudge filters during checkout & crash consistency

2014-11-12 Thread Derek Moore
I have a case where I would like to smudge files according to the reflog information of the switching-to branch. This is difficult to achieve because updating HEAD to the new switched-to refname or commit hash is the last step performed in a checkout prior to calling the post-checkout hook, and sm