git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Update tests to use test-chmtime

From
EWEric Wong <normalperson@yhbt.net>
Date
Feb 25, 2007, 19:23 UTC
Message-ID
<20070225192329.GA13535@localdomain>
In-Reply-To
<7vzm72vhl4.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
Show 23 quoted lines
> Eric Wong <normalperson@yhbt.net> 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.
Show 7 quoted lines
> 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
Previous: Johannes SchindelinNext: Junio C Hamano
Message 5 of 9 in “Add test-chmtime: a utility to change mtime on files”
  1. Add test-chmtime: a utility to change mtime on filesEric Wong, Feb 25, 2007
  2. Update tests to use test-chmtimeEric Wong, Feb 25, 2007
  3. Junio C HamanoFeb 25, 2007
  4. Johannes SchindelinFeb 25, 2007
  5. Eric WongFeb 25, 2007
  6. Junio C HamanoFeb 25, 2007
  7. Johannes SchindelinFeb 25, 2007
  8. Eric WongFeb 25, 2007
  9. Add test-chmtime: a utility to change mtime on filesEric Wong, Feb 25, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.