Re: [PATCH 16/33] t3210: test for spurious error messages for dangling packed refs
- From
Michael Haggerty <mhagger@alum.mit.edu>
- Date
- Apr 16, 2013, 14:14 UTC
- Message-ID
- <516D5CC6.10505@alum.mit.edu>
- In-Reply-To
- <7vobdfvglf.fsf@alter.siamese.dyndns.org>
On 04/15/2013 07:39 PM, Junio C Hamano wrote:
> Michael Haggerty <mhagger@alum.mit.edu> 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 mhagger@alum.mit.edu http://softwareswirl.blogspot.com/