Re: git smudge filter fails

2016-03-15 Thread Junio C Hamano
Stephen Morton writes: > It's perhaps beyond the scope of my original question, but for > situations where I need a "last change date" embedded in a file (e.g. > because a protocol standard requires it), is there any recommended way > to do so? We've the hard way that hardcoding makes > merging/c

Re: git smudge filter fails

2016-03-15 Thread Stephen Morton
On Thu, Mar 10, 2016 at 5:04 PM, Junio C Hamano wrote: > Jeff King writes: > >> On Thu, Mar 10, 2016 at 09:45:19AM -0500, Stephen Morton wrote: >> >>> I am a bit confused because this is basically the example used in >>> ProGit [1] and it is fundamentally broken. In fact, if I understand >>> corr

Re: git smudge filter fails

2016-03-10 Thread Junio C Hamano
Jeff King writes: > On Thu, Mar 10, 2016 at 09:45:19AM -0500, Stephen Morton wrote: > >> I am a bit confused because this is basically the example used in >> ProGit [1] and it is fundamentally broken. In fact, if I understand >> correctly, this means that smudge filters cannot be relied upon to >

Re: git smudge filter fails

2016-03-10 Thread Jeff King
On Thu, Mar 10, 2016 at 09:45:19AM -0500, Stephen Morton wrote: > I am a bit confused because this is basically the example used in > ProGit [1] and it is fundamentally broken. In fact, if I understand > correctly, this means that smudge filters cannot be relied upon to > provide any 'keyword expa

Re: git smudge filter fails

2016-03-10 Thread Stephen Morton
I am a bit confused because this is basically the example used in ProGit [1] and it is fundamentally broken. In fact, if I understand correctly, this means that smudge filters cannot be relied upon to provide any 'keyword expansion' type tasks because they will all by nature have to query the file

Re: git smudge filter fails

2016-03-09 Thread Jeff King
On Wed, Mar 09, 2016 at 01:29:31PM -0500, Stephen Morton wrote: > git config --local filter.dater.smudge 'myDate=`git log > --pretty=format:"%cd" --date=iso -1 -- %f`; sed -e > "s/\(\\$\)Date[^\\$]*\\$/\1Date: $myDate \\$/g"' Your filter is running "git log" without a revision parameter, which me

git smudge filter fails

2016-03-09 Thread Stephen Morton
A git smudge filter, at least one that relies on the results from 'git log' does not seem to work on file A when doing a 'git update' from a revision where file A doesn't exist to a revision where it does exist. Below is a simple recipe to reproduce. This appears to me to be a bug. If not, why is