Re: [PATCH] guilt: Make sure the commit time is increasing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jul 04, 2010 at 10:51:17PM -0400, tytso@xxxxxxx wrote:
> On Sun, Jul 04, 2010 at 10:23:59PM -0400, Theodore Ts'o wrote:
> > +		ct=$(git log -1 --pretty=%ct)
> > +		if [ $ct -gt $(stat -c %Y "$p") ]; then
> > +		    echo "Warning time went backwards, adjusting mod time of" \
> > +			$(basename "$p")
> > +		    touch -d @$(expr $ct + 60) "$p" || touch "$p"
>                                                     ^^^^^^^^^^^^^
> 
> hmm, I just realized, this is strictly speaking not necessary.
> 
> "stat -c %Y" means that guilt only works if GNU coreutils is
> installed, which means that "touch -d @secs-since-epoch" should also
> work.
> 
> This will be a problem on legacy systems such as Solaris (unless their
> path puts the GNU utilities head of their System V-style utilities),
> but that's going to be true of guilt in general, it looks like.

I've been meaning to make guilt less GNU-dependant, but I just don't use
non-Linux systems enough (read: almost never) to do it myself.

Jeff.

-- 
The box said "Windows XP or better required". So I installed Linux.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]