From: Eric Wong Date: Sun, 25 Feb 2007 19:23:29 GMT Subject: Re: [PATCH] Update tests to use test-chmtime Message-ID: <20070225192329.GA13535@localdomain> In-Reply-To: <7vzm72vhl4.fsf@assigned-by-dhcp.cox.net> Junio C Hamano wrote: > Eric Wong writes: > > > -case "$(date -d @11111111 +%s 2>/dev/null)" in > > -11111111) > > ... > > - touch -m -t "$predate1" $rr/preimage > > - touch -m -t "$predate2" $rr2/preimage > > ... > > -esac > > +now=$(date +%s) > > +almost_15_days_ago=$(($now+60-15*86400)) > > +just_over_15_days_ago=$(($now-1-15*86400)) > > +almost_60_days_ago=$(($now+60-60*86400)) > > +just_over_60_days_ago=$(($now-1-60*86400)) > > + > > +test-chmtime =$almost_60_days_ago $rr/preimage > > +test-chmtime =$almost_15_days_ago $rr2/preimage > > Very nice. > I've been wanting to get rid of this part for quite a while. > > However, is '+%s' output portable enough for this change to be > an improvement? Looks like not. > I would suggest changing "test-chmtime =-200 file" to set the > mtime of the file to 200 seconds in the past, relative to > present. > > --- > diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh > index d5bb6ec..639d45f 100755 Your patch looks good to me. -- Eric Wong