Subject: Re: [PATCH 16/33] t3210: test for spurious error messages for dangling packed refs

From: Michael Haggerty <[email-masked]>
Date: Tue, 16 Apr 2013 16:14:30 +0200

On 04/15/2013 07:39 PM, Junio C Hamano wrote:
> Michael Haggerty <[email-masked]> writes:
>> How can I get rid of the sleeps in these tests?
> 
> Would test-chmtime help?

Maybe I should take a step back and ask why it isn't easier to expire
things regardless of age, which is sometimes a reasonable thing to do
even outside of test suites.  In particular, it seem to me that the most
obvious interpretation of

	git reflog expire --expire=now --all

would be that it expires *everything*.  But in fact it seems to only
expire things that are at least one second old, which doesn't seem at
all useful in the real world.  "--expire=all" is accepted without
complaint but doesn't do what one would hope.  Something like
"--expire=$(($(date +%s)+3600))" works, but it is not very convenient
(is it portable?).

I guess I can use test-chmtime for my particular test, though I will
have to pass it the explicit names of the logfile(s), like

    find .git/logs -type f -print0 | xargs -0 test-chmtime =-60

I guess that's what I'll do if no better solution comes up.

Michael

-- 
Michael Haggerty
[email-masked]
http://softwareswirl.blogspot.com/