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

Re: [PATCH v2 1/2] t5319: replace 'touch -m' with 'test-tool chmtime'

From
Jeff King <peff@peff.net>
Date
Apr 2, 2020, 12:51 UTC
Message-ID
<20200402125113.GA3091800@coredump.intra.peff.net>
In-Reply-To
<8e6b1f75-534a-ad79-544b-126ea61b2058@gmail.com>
On Wed, Apr 01, 2020 at 08:06:47PM -0400, Derrick Stolee wrote:
Show 16 quoted lines
> > Also, in the best case (i.e. original timestamp of A/B/C/D are the
> > same), the above seems to assume that the filesystem has at least 1
> > second file timestamp granularity.  Do we want to make them at least
> > 2 seconds apart, or am I worried too much about ancient filesystems
> > that no longer metter?
> 
> The old test relied on one-second granularity, so that hasn't changed.
> I could easily space it out a bit more without issue.
> 
> Your concern about the original timestamps getting skewed shouldn't
> be an issue because "test-tool chmtime =-<seconds>" subtracts the
> <seconds> from the current system time, not the file's mtime. This
> is subtle: without the "=" it would modify it from the file's mtime.
> 
> Since we are assigning the offset values in the proper order (D to A)
> there isn't an issue if time ticks forward between these steps.

I wonder if that would run afoul of the same "mtime and system clock are not quite the same" issue we saw recently in [1].

I think it might not because we're only comparing mtimes set through the same mechanism (find the system time, subtract from it, and assign to mtime). If system time is monotonically increasing at any rate, that would produce the desired effect.

That said, it seems so easy to just give it a 10 second (or even 10 minute) spread to avoid any possibility of confusion.

-Peff
[1] https://lore.kernel.org/git/pull.725.git.git.1584125875550.gitgitgadget@gmail.com/
Previous: Derrick StoleeNext: Junio C Hamano
Message 17 of 20 in “commit-graph: fix buggy --expire-time option”
  1. commit-graph: fix buggy --expire-time optionDerrick Stolee via GitGitGadget, Apr 1, 2020
  2. Derrick StoleeApr 1, 2020
  3. Taylor BlauApr 1, 2020
  4. Taylor BlauApr 1, 2020
  5. Eric SunshineApr 1, 2020
  6. SZEDER GáborApr 1, 2020
  7. Junio C HamanoApr 1, 2020
  8. Jeff KingApr 1, 2020
  9. Junio C HamanoApr 1, 2020
  10. Derrick StoleeApr 1, 2020
  11. Derrick StoleeApr 1, 2020
  12. 0/2 commit-graph: fix buggy --expire-time optionDerrick Stolee via GitGitGadget, Apr 1, 2020
  13. 2/2 commit-graph: fix buggy --expire-time optionDerrick Stolee via GitGitGadget, Apr 1, 2020
  14. 1/2 t5319: replace 'touch -m' with 'test-tool chmtime'Derrick Stolee via GitGitGadget, Apr 1, 2020
  15. Junio C HamanoApr 1, 2020
  16. Derrick StoleeApr 2, 2020
  17. Jeff KingApr 2, 2020
  18. Junio C HamanoApr 2, 2020
  19. Junio C HamanoApr 1, 2020
  20. Derrick StoleeApr 1, 2020

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.