All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Benjamin Woodruff via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Benjamin Woodruff <github@benjam.info>
Subject: [PATCH 0/2] describe and diff: implement --no-optional-locks
Date: Thu, 06 Mar 2025 05:58:03 +0000	[thread overview]
Message-ID: <pull.1872.git.1741240685.gitgitgadget@gmail.com> (raw)

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

             reply	other threads:[~2025-03-06  5:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-06  5:58 Benjamin Woodruff via GitGitGadget [this message]
2025-03-06  5:58 ` [PATCH 1/2] describe: implement --no-optional-locks Benjamin Woodruff via GitGitGadget
2025-03-06  5:58 ` [PATCH 2/2] diff: " Benjamin Woodruff via GitGitGadget
2025-03-06 16:11 ` [PATCH 0/2] describe and " Junio C Hamano
2025-03-09  3:39   ` Jeff King
2025-03-10 12:25     ` Junio C Hamano
2025-03-10 16:08       ` Jeff King
2025-03-10 18:53         ` Junio C Hamano
2025-03-10 20:50           ` Benjamin Woodruff
2025-03-10 23:04             ` Junio C Hamano
2025-03-11  2:10             ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.1872.git.1741240685.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=github@benjam.info \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.