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

Re: [PATCH 5/6] t7063: use POSIX find(1) syntax

From
Danh Doan <congdanhqx@gmail.com>
Date
Mar 20, 2020, 01:41 UTC
Message-ID
<20200320014142.GF1858@danh.dev>
In-Reply-To
<xmqqsgi4c7o6.fsf@gitster.c.googlers.com>
On 2020-03-19 15:16:09-0700, Junio C Hamano <gitster@pobox.com> wrote:
Show 14 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > On Thu, Mar 19, 2020 at 09:00:06PM +0700, Đoàn Trần Công Danh wrote:
> >
> >> Since commit 6b7728db81, (t7063: work around FreeBSD's lazy mtime
> >> update feature, 2016-08-03), we started to use ls as a trick to update
> >> directory's mtime.
> >> 
> >> However, `-ls` flag isn't required by POSIX's find(1), and
> >> busybox(1) doesn't implement it.
> >> 
> >> Use an equivalence `-exec ls -dils {} +` instead.
> >
> > Makes sense. I wonder if we need all of "-dils", but it's not clear to

From the original commit message, I think whichever flags that call stat(2) would be do it. It's `-d` (to check is_directory), and `-i` for inode number.

This make make wonder, will it be enough to just use:
	find . -type d >/dev/null
Show 10 quoted lines
> > me which syscalls actually trigger the FreeBSD lazy-update behavior. I
> > guess probably it's stat()ing the directory, so "ls -ld" would be
> > sufficient (and that's implied by the examples in 6b7728db81).
> >
> > But I doubt the extra options would create a portability problem, so I
> > think it's fine either way.
> 
> Thanks.  I too wondered if -dils is really needed (POSIX of course
> have all of them, but we have to deal with non-POSIX systems, too,
> and I am not sure how things like "-i" works there).

I think "-i" asks for stat(2) to get inode number, which will ask FreeBSD sync mtime.

> 
> s/equivalence/equivalent/; perhaps?
Will do, I've never correctly used -ence and -ent pairs of words.
-- 
Danh
Previous: Junio C HamanoNext: Danh Doan
Message 21 of 35 in “fix test failure with busybox”
  1. 0/6 fix test failure with busyboxĐoàn Trần Công Danh, Mar 19, 2020
  2. 1/6 t4061: use POSIX compliance regex(7)Đoàn Trần Công Danh, Mar 19, 2020
  3. Jeff KingMar 19, 2020
  4. Eric SunshineMar 19, 2020
  5. Junio C HamanoMar 19, 2020
  6. Danh DoanMar 20, 2020
  7. 2/6 test-lib-functions: test_cmp: eval $GIT_TEST_CMPĐoàn Trần Công Danh, Mar 19, 2020
  8. Jeff KingMar 19, 2020
  9. Eric SunshineMar 19, 2020
  10. Danh DoanMar 20, 2020
  11. 3/6 t5003: skip conversion test if unzip -a is unavailableĐoàn Trần Công Danh, Mar 19, 2020
  12. Jeff KingMar 19, 2020
  13. Danh DoanMar 20, 2020
  14. Jeff KingMar 20, 2020
  15. 4/6 t5616: use rev-parse instead to get HEAD's object_idĐoàn Trần Công Danh, Mar 19, 2020
  16. Jeff KingMar 19, 2020
  17. Danh DoanMar 20, 2020
  18. 5/6 t7063: use POSIX find(1) syntaxĐoàn Trần Công Danh, Mar 19, 2020
  19. Jeff KingMar 19, 2020
  20. Junio C HamanoMar 19, 2020
  21. Danh DoanMar 20, 2020
  22. Danh DoanMar 20, 2020
  23. Jeff KingMar 20, 2020
  24. Danh DoanMar 22, 2020
  25. Jeff KingMar 22, 2020
  26. 6/6 t4124: fix test for non-compliance diffĐoàn Trần Công Danh, Mar 19, 2020
  27. Jeff KingMar 19, 2020
  28. Junio C HamanoMar 19, 2020
  29. Jeff KingMar 20, 2020
  30. Danh DoanMar 20, 2020
  31. Jeff KingMar 20, 2020
  32. Jeff KingMar 19, 2020
  33. Danh DoanMar 20, 2020
  34. Jeff KingMar 20, 2020
  35. Jeff KingMar 19, 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.