This is one way I deal with the fact that git has no option to respect mtime.
powershell use-commit-times.ps1
'git whatchanged' is nominated for removal. If you still use this command, please add an extra option, '--i-still-use-this', on the command line and let us know you still use it by sending an e-mail to <mailto:git@vger.kernel.org>. Thanks. fatal: refusing to run without --i-still-use-this
use-commit-times.ps1:
#use-commit-times
[string[]]$changes = &git whatchanged --reverse --pretty=%at
$mtime = [DateTime]::Now;
[string]$change = $null;
foreach($change in $changes)
{
if($change.Length -eq 0) { continue; }
if($change[0] -eq ":")
{
$parts = $change.Split("`t");
$file = $parts[$parts.Length - 1];
if([System.IO.File]::Exists($file))
{
[System.IO.File]::SetLastWriteTimeUtc($file, $mtime);
}
}
else
{
$mtime = [DateTimeOffset]::FromUnixTimeSeconds([Int64]::Parse($change)).DateTime;
}
}Roy Lomicka Software Developer p: (978) 367-3518 e: mailto:rlomicka@concord.net w: http://www.concord.net/
Concord Technologies and Biscom have come together to better serve you, https://concord.net/concord-technologies-acquires-biscom/.