Re: Git for Windows: mingw.c's strange usage of creation time as ctime?
- Date: Tue, 3 Oct 2017 19:23:52 -0700
- From: Jonathan Nieder <jrnieder@xxxxxxxxx>
- Subject: Re: Git for Windows: mingw.c's strange usage of creation time as ctime?
Marc Strapetz wrote:
> compat/mingw.c assigns the Windows file creation time  to Git's
> ctime fields at line 591 and at line 705:
> buf->st_ctime = filetime_to_time_t(&(fdata.ftCreationTime));
> ftCreationTime > ftLastWriteTime is actually possible after copying
> a file, so it makes sense to include this timestamp somehow in the
> Index, but I think it would be better to use the maximum of
> ftLastWriteTime and ftCreationTime here which is less confusing and
> closer to Unix's ctime:
> buf->st_ctime = max(buf->st_mtime,
Can you say more about the practical effect? Is this causing a bug in
practice, is it a bug waiting to happen, or is it making the code
difficult to understand without any ill effect expected at run time?
(Any of those three is a valuable kind of feedback to offer --- I'm
just trying to figure out which one you mean.)
By the way, do you have core.trustctime set to true or false?
>  https://msdn.microsoft.com/en-us/library/windows/desktop/aa365739(v=vs.85).aspx