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

Re: [PATCH v2] mv: refresh stat info for moved entry

From
Derrick Stolee <derrickstolee@github.com>
Date
Mar 29, 2022, 18:54 UTC
Message-ID
<d017b0c6-c06b-e8cd-55a1-6972a9ae7c52@github.com>
In-Reply-To
<xmqqa6d8wvwt.fsf@gitster.g>
On 3/29/2022 12:44 PM, Junio C Hamano wrote:
Show 13 quoted lines
> Derrick Stolee <derrickstolee@github.com> writes:
> 
>>> Note that the test added in 't7001-mv.sh' requires a "sleep 1" to ensure the
>>> 'ctime' of the file creation will be definitively older than the 'ctime' of
>>> the renamed file in 'git mv'.
>>
>> Unfortunate that this is necessary, but it seems to be the only way
>> to handle this because of the interaction with the system clock and
>> the filesystem. There are several sleeps like this in
>> t1701-racy-split-index.sh, for example.
> 
> Does "test-tool chmtime" to tweak the filesystem timestamp help?  I
> didn't look at the specific step that uses sleep to work around.

The issue here is related to ctime, which is not modified by that helper. It also uses utime() which does not seem to have a way to modify ctime (which makes sense).

Thanks, -Stolee

Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 10 in “mv: refresh stat info for moved entry”
  1. mv: refresh stat info for moved entryVictoria Dye via GitGitGadget, Mar 25, 2022
  2. Derrick StoleeMar 25, 2022
  3. Victoria DyeMar 25, 2022
  4. Junio C HamanoMar 25, 2022
  5. Victoria DyeMar 26, 2022
  6. mv: refresh stat info for moved entryVictoria Dye via GitGitGadget, Mar 29, 2022
  7. Derrick StoleeMar 29, 2022
  8. Junio C HamanoMar 29, 2022
  9. Derrick StoleeMar 29, 2022
  10. Junio C HamanoMar 29, 2022

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.