Re: Git enhancement request - checkout (clone) set modified dates to commit date

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

 



On Sun, Apr 22, 2018 at 01:18:10PM -0400, Andrew Wolfe wrote:
> I would like to propose that the checkout process set the create and modification times of a file to the timestamp at which a file was committed.

The reason Git doesn't do this is pretty simple: make and various other
tools do rebuilds depending on timestamps.

If I create a branch off master and make some commits, then switch back
to master, I will want the changed files to have their timestamps
updated to be newer so that a make on master will rebuild dependencies
based on those files.  If I set the files to the commit timestamp, those
files would be set to the timestamp of master, which is older than my
new branch, and make wouldn't work properly.

There are some cases where people want the behavior you requested, such
as for reproducible builds, and in such cases, you can use a
post-checkout hook to set timestamps with touch.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

Attachment: signature.asc
Description: PGP signature


[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]

  Powered by Linux