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
Junio C Hamano <gitster@pobox.com>
Date
Apr 2, 2020, 16:36 UTC
Message-ID
<xmqqo8s94zgf.fsf@gitster.c.googlers.com>
In-Reply-To
<20200402125113.GA3091800@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> On Wed, Apr 01, 2020 at 08:06:47PM -0400, Derrick Stolee wrote:
>
> 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 had the exact thing in mind, which was why I suggested "chmtime" in the first place (the second reason was that it was easy to do relative time using the tool than "date + touch"), but I missed that the tool has a mode that uses timestamp relative to system clock.

> 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.

But in this particular case, I think, even though setting the filesystem timestamp based on something that was obtained from the system clock feels as if we are asking for trouble, the values we later read back from the filesystem for executing the codepath being tested (namely, expiration logic) get compared with another value that is derived from from the system clock (i.e. expiration cutoff), so in that sense you might be able to argue that it is even more correct ;-)

Previous: Jeff KingNext: Junio C Hamano
Message 18 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.