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

[PATCH 0/2] describe and diff: implement --no-optional-locks

From
BGBenjamin Woodruff via GitGitGadget <gitgitgadget@gmail.com>
Date
Mar 6, 2025, 05:58 UTC
Message-ID
<pull.1872.git.1741240685.gitgitgadget@gmail.com>

git describe and git diff may update the index in the background for similar performance reasons to git-status. These patches implement the --no-optional-locks option for these commands, which allows scripts to bypass this behavior.

I'm implementing this as a solution to a stale lockfile issue we've sporadically encountered due to a build script that runs git describe. We're mitigating this issue by using libgit2 in our build script, which does not have the same background update behavior for its git_describe_workdir implementation, but it would be nice to have this option supported in the git CLI.

Tests and documentation changes are included!
Benjamin Woodruff (2):
  describe: implement --no-optional-locks
  diff: implement --no-optional-locks
 Documentation/config/diff.adoc     |  4 ++-
 Documentation/git-describe.adoc    | 12 ++++++++
 Documentation/git.adoc             |  4 ++-
 builtin/describe.c                 | 12 ++++----
 builtin/diff.c                     |  4 +++
 t/meson.build                      |  1 +
 t/t4070-diff-auto-refresh-index.sh | 46 ++++++++++++++++++++++++++++++
 t/t6120-describe.sh                |  8 ++++++
 8 files changed, 84 insertions(+), 7 deletions(-)
 create mode 100755 t/t4070-diff-auto-refresh-index.sh
base-commit: e969bc875963a10890d61ba84eab3a460bd9e535
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1872%2Fbgw%2Fbgw%2Fdiff-describe-optional-locks-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1872/bgw/bgw/diff-describe-optional-locks-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1872
-- 
gitgitgadget
Next: Benjamin Woodruff via GitGitGadget
Message 1 of 11 in “describe and diff: implement --no-optional-locks”
  1. 0/2 describe and diff: implement --no-optional-locksBenjamin Woodruff via GitGitGadget, Mar 6, 2025
  2. 1/2 describe: implement --no-optional-locksBenjamin Woodruff via GitGitGadget, Mar 6, 2025
  3. 2/2 diff: implement --no-optional-locksBenjamin Woodruff via GitGitGadget, Mar 6, 2025
  4. Junio C HamanoMar 6, 2025
  5. Jeff KingMar 9, 2025
  6. Junio C HamanoMar 10, 2025
  7. Jeff KingMar 10, 2025
  8. Junio C HamanoMar 10, 2025
  9. Benjamin WoodruffMar 10, 2025
  10. Junio C HamanoMar 10, 2025
  11. Jeff KingMar 11, 2025

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.