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

[PATCH v6 0/3] Convert USE_NSEC to runtime config

From
D. Ben Knoble <ben.knoble@gmail.com>
Date
Aug 31, 2026, 20:01 UTC
Message-ID
<cover.1788206466.git.ben.knoble@gmail.com>
In-Reply-To
<cover.1787231825.git.ben.knoble@gmail.com>
Topic name: dk/use-nsec-runtime (applied)

Topic summary: Expose USE_NSEC as a runtime configuration, since build-time is too early for distributing Git [1]. As a result, common index-related options, like git-diff, are less likely to hit "racy git" problems on supported filesystems.

[1]: https://git.github.io/rev_news/2026/07/31/edition-137/
Built on master (2c78326f81 (The 11th batch, 2026-08-05)).
Changes in v5:
- improve message flow in patch 2
Changes in v4:
- fix message typo
- change #ifdef strategy: only ignore the config variable.
  Otherwise, use the use_nanosec member unconditionally. Also clarify
  that config might be ignore depending on build options in the docs.
- mention potential platform unsafety directly in config doc in
  addition to the link to Racy Git
Changes in v3:
- #ifdef out use_nanosec when NO_NSEC is requested

As I have heard no comments about the "Todo" lines below, which perhaps could more clearly be marked "RFC"/"RFH", I've added this line to call them out ;) and renamed them "Comments welcome"

Changes in v2:
- move Best-viewed-with trailer into message body as descriptive
  text.
- read core.useNanosec through struct repo instead of parsing
  config strings. The test suite passes locally this way, though that
  skipped 151 tests.
    - CI run: https://github.com/benknoble/git/actions/runs/31701945211
Original cover letter:

Hi all, this series follows up on the previous racy Git/USE_NSEC conversations.

- The first patch is a mostly-unrelated documentation fix for Meson, but
  it came out of something I spotted while reviewing the outputs of the
  final (main) patch.
- The second patch is a preliminary no-op reorganization of
  repo_config_values_init.
- The third patch is the meat, converting USE_NSEC into core.useNanosec.

There is a small textual and semantic conflict with 'ty/repo-config-cleanups' in 'seen', since that branch removes the comments in 'struct repo_config_values' which this series adds to. (The semantic conflict is that, if we drop those comments, we should probably not add them to repo_config_values_init like I do in patch 2.)

Comments welcome: I haven't touched any tests; I saw a bunch of hits for "git grep racy t" but wasn't sure how to fit this particular change in, especially since it won't be equally valid on all systems? Advice welcome.

Comments welcome: I wonder if "useNanosec" paints us into too much of a
corner; that is (slightly more abstractly), we are using *extended
precision* in the index. Maybe the name and documentation should reflect
that, so we aren't too committed to "nanoseconds"?
    - Some platforms could offer extended precision that is not as
      precise as nanoseconds
    - Some could offer precision _beyond_ nanoseconds
idk.

v1: <cover.1786103607.git.ben.knoble@gmail.com> v2: <cover.1786710807.git.ben.knoble@gmail.com> v3: <cover.1787065125.git.ben.knoble@gmail.com> v4: <cover.1787231825.git.ben.knoble@gmail.com> v5: <cover.1788010335.git.ben.knoble@gmail.com>

[1/3] meson: expose knob for xmlto relative links in manuals [2/3] environment: align repo_config_values_init with struct declaration [3/3] core: convert build-time USE_NSEC into runtime core.useNanosec

 Documentation/config/core.adoc        |  7 +++++++
 Documentation/meson.build             |  7 ++++++-
 Documentation/technical/racy-git.adoc | 11 ++++++-----
 Makefile                              | 12 +-----------
 builtin/update-index.c                |  2 +-
 compat/posix.h                        |  1 -
 configure.ac                          |  6 ------
 environment.c                         | 27 ++++++++++++++++++++-------
 environment.h                         |  1 +
 meson_options.txt                     |  2 ++
 read-cache.c                          | 15 ++++++---------
 statinfo.c                            | 14 +++++++-------
 12 files changed, 57 insertions(+), 48 deletions(-)
Diff-intervalle contre v5 :
1:  d612de6c2d = 1:  d612de6c2d meson: expose knob for xmlto relative links in manuals
2:  12974e07d0 = 2:  12974e07d0 environment: align repo_config_values_init with struct declaration
3:  01cd487cd2 ! 3:  0a611f6140 core: convert build-time USE_NSEC into runtime core.useNanosec
    @@ builtin/update-index.c: static void xrmdir(const char *path)
      {
      	/*
     -	 * not use if we could usleep(10) if USE_NSEC is defined. The
    -+	 * not use if we could usleep(10) if core.useNanosec is defined. The
    ++	 * not use if we could usleep(10) if core.useNanosec is enabled. The
      	 * field nsec could be there, but the OS could choose to
      	 * ignore it?
      	 */
base-commit: 2c78326f810173a4f3aefd8021f1e07575412481
-- 
2.55.0.860.g4b6b3295ed.dirty
Previous: Ben KnobleNext: D. Ben Knoble
Message 51 of 74 in “Convert USE_NSEC to runtime config”
  1. 0/3 Convert USE_NSEC to runtime configD. Ben Knoble, Aug 7, 2026
  2. 1/3 meson: expose knob for xmlto relative links in manualsD. Ben Knoble, Aug 7, 2026
  3. Patrick SteinhardtAug 10, 2026
  4. 2/3 environment: align repo_config_values_init with struct declarationD. Ben Knoble, Aug 7, 2026
  5. 3/3 core: convert build-time USE_NSEC into runtime core.useNanosecD. Ben Knoble, Aug 7, 2026
  6. Junio C HamanoAug 7, 2026
  7. SZEDER GáborAug 8, 2026
  8. D. Ben KnobleAug 10, 2026
  9. D. Ben KnobleAug 10, 2026
  10. Patrick SteinhardtAug 10, 2026
  11. Ben KnobleAug 11, 2026
  12. D. Ben KnobleAug 13, 2026
  13. Patrick SteinhardtAug 14, 2026
  14. Ben KnobleAug 14, 2026
  15. Patrick SteinhardtAug 10, 2026
  16. 0/3 Convert USE_NSEC to runtime configD. Ben Knoble, Aug 14, 2026
  17. 1/3 meson: expose knob for xmlto relative links in manualsD. Ben Knoble, Aug 14, 2026
  18. 2/3 environment: align repo_config_values_init with struct declarationD. Ben Knoble, Aug 14, 2026
  19. 3/3 core: convert build-time USE_NSEC into runtime core.useNanosecD. Ben Knoble, Aug 14, 2026
  20. Junio C HamanoAug 14, 2026
  21. D. Ben KnobleAug 14, 2026
  22. 0/3 Convert USE_NSEC to runtime configD. Ben Knoble, Aug 18, 2026
  23. 1/3 meson: expose knob for xmlto relative links in manualsD. Ben Knoble, Aug 18, 2026
  24. 2/3 environment: align repo_config_values_init with struct declarationD. Ben Knoble, Aug 18, 2026
  25. 3/3 core: convert build-time USE_NSEC into runtime core.useNanosecD. Ben Knoble, Aug 18, 2026
  26. Junio C HamanoAug 18, 2026
  27. D. Ben KnobleAug 19, 2026
  28. Patrick SteinhardtAug 19, 2026
  29. D. Ben KnobleAug 19, 2026
  30. Patrick SteinhardtAug 20, 2026
  31. D. Ben KnobleAug 20, 2026
  32. Junio C HamanoAug 19, 2026
  33. D. Ben KnobleAug 19, 2026
  34. Patrick SteinhardtAug 20, 2026
  35. 0/3 Convert USE_NSEC to runtime configD. Ben Knoble, Aug 20, 2026
  36. 1/3 meson: expose knob for xmlto relative links in manualsD. Ben Knoble, Aug 20, 2026
  37. 2/3 environment: align repo_config_values_init with struct declarationD. Ben Knoble, Aug 20, 2026
  38. Junio C HamanoAug 20, 2026
  39. D. Ben KnobleAug 21, 2026
  40. 3/3 core: convert build-time USE_NSEC into runtime core.useNanosecD. Ben Knoble, Aug 20, 2026
  41. 0/3 Convert USE_NSEC to runtime configD. Ben Knoble, Aug 29, 2026
  42. 1/3 meson: expose knob for xmlto relative links in manualsD. Ben Knoble, Aug 29, 2026
  43. 2/3 environment: align repo_config_values_init with struct declarationD. Ben Knoble, Aug 29, 2026
  44. 3/3 core: convert build-time USE_NSEC into runtime core.useNanosecD. Ben Knoble, Aug 29, 2026
  45. Junio C HamanoAug 30, 2026
  46. D. Ben KnobleAug 31, 2026
  47. Patrick SteinhardtAug 31, 2026
  48. D. Ben KnobleAug 31, 2026
  49. Patrick SteinhardtAug 31, 2026
  50. Ben KnobleAug 31, 2026
  51. 0/3 Convert USE_NSEC to runtime configD. Ben Knoble, Aug 31, 2026
  52. 1/3 meson: expose knob for xmlto relative links in manualsD. Ben Knoble, Aug 31, 2026
  53. 2/3 environment: align repo_config_values_init with struct declarationD. Ben Knoble, Aug 31, 2026
  54. 3/3 core: convert build-time USE_NSEC into runtime core.useNanosecD. Ben Knoble, Aug 31, 2026
  55. Junio C HamanoSep 1, 2026
  56. D. Ben KnobleSep 1, 2026
  57. Junio C HamanoSep 1, 2026
  58. Jeff KingSep 1, 2026
  59. D. Ben KnobleSep 1, 2026
  60. Jeff KingSep 2, 2026
  61. Ben KnobleSep 2, 2026
  62. Junio C HamanoSep 2, 2026
  63. Ben KnobleSep 3, 2026
  64. Junio C HamanoSep 3, 2026
  65. Ben KnobleSep 3, 2026
  66. D. Ben KnobleAug 31, 2026
  67. 0/3 Convert USE_NSEC to runtime configD. Ben Knoble, Sep 11, 2026
  68. 1/3 meson: expose knob for xmlto relative links in manualsD. Ben Knoble, Sep 11, 2026
  69. 2/3 environment: align repo_config_values_init with struct declarationD. Ben Knoble, Sep 11, 2026
  70. 3/3 core: convert build-time USE_NSEC into runtime core.useNanosecD. Ben Knoble, Sep 11, 2026
  71. Junio C HamanoSep 11, 2026
  72. Ben KnobleSep 11, 2026
  73. Patrick SteinhardtAug 31, 2026
  74. Ben KnobleSep 1, 2026

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.