Git development
 help / color / mirror / Atom feed
From: "Wyatt Holden via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, stolee@gmail.com, wyattj.holden@gmail.com,
	Wyatt Holden <wyattholden@microsoft.com>
Subject: [PATCH 3/3] scalar: disable orphaned commit checks by default
Date: Tue, 10 Nov 2026 19:12:00 +0000	[thread overview]
Message-ID: <f24d4019e889b12cd6237217c3cf31f47aa318d5.1794337920.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.2264.git.1794337920.gitgitgadget@gmail.com>

From: Wyatt Holden <wyattholden@microsoft.com>

Checking for commits left behind when leaving a detached HEAD can
be expensive in large repositories. Add
checkout.orphanedCommitWarning=false to Scalar's recommended settings
to avoid this foreground work while preserving normal checkout output.

Use the existing set-if-missing behavior so explicit user choices
are preserved during clone, register, and reconfigure. Document the
loss of the immediate orphan warning and the availability of reflog
recovery. Existing Scalar tests cover configuration preservation,
so no additional inventory of recommended settings is needed.

Signed-off-by: Wyatt Holden <wyattholden@microsoft.com>
---
 Documentation/scalar.adoc | 7 +++++++
 scalar.c                  | 1 +
 2 files changed, 8 insertions(+)

diff --git a/Documentation/scalar.adoc b/Documentation/scalar.adoc
index 5252fb134a..d2b8c9a6ca 100644
--- a/Documentation/scalar.adoc
+++ b/Documentation/scalar.adoc
@@ -214,6 +214,13 @@ am.keepCR=true::
 	and non-Windows platforms and keeping carriage return (`\r`) characters
 	in certain workflows.
 
+checkout.orphanedCommitWarning=false::
+	This disables the reachability check that warns about commits left
+	behind when `git checkout` or `git switch` leaves a detached `HEAD`.
+	The check can be expensive in large repositories. Other checkout
+	output is unchanged, and commits left behind can still be found
+	in the `HEAD` reflog until its entries expire.
+
 commitGraph.changedPaths=true::
 	This setting helps the background maintenance steps that compute the
 	serialized commit-graph to also store changed-path Bloom filters. This
diff --git a/scalar.c b/scalar.c
index a80d8ee3ff..7f851f5610 100644
--- a/scalar.c
+++ b/scalar.c
@@ -138,6 +138,7 @@ static int set_recommended_config(int reconfigure)
 	 */
 	struct scalar_config config[] = {
 		{ "am.keepCR", "true" },
+		{ "checkout.orphanedCommitWarning", "false" },
 		{ "commitGraph.changedPaths", "true" },
 		{ "commitGraph.generationVersion", "1" },
 		{ "core.autoCRLF", "false" },
-- 
gitgitgadget

  parent reply	other threads:[~2026-11-10 19:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 19:11 [PATCH 0/3] Make orphaned commit checks configurable Wyatt Holden via GitGitGadget
2026-11-10 19:11 ` [PATCH 1/3] checkout: make " Wyatt Holden via GitGitGadget
2026-11-10 22:05   ` Junio C Hamano
2026-11-10 19:11 ` [PATCH 2/3] checkout: advise when orphaned commit checks are slow Wyatt Holden via GitGitGadget
2026-11-10 20:48   ` Derrick Stolee
2026-11-10 22:22     ` Junio C Hamano
2026-11-11 18:52   ` Junio C Hamano
2026-11-10 19:12 ` Wyatt Holden via GitGitGadget [this message]
2026-11-10 20:57 ` [PATCH 0/3] Make orphaned commit checks configurable Derrick Stolee
2026-11-10 22:29 ` Junio C Hamano

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=f24d4019e889b12cd6237217c3cf31f47aa318d5.1794337920.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=stolee@gmail.com \
    --cc=wyattholden@microsoft.com \
    --cc=wyattj.holden@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox