Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Phillip Wood <phillip.wood123@gmail.com>
Cc: "D. Ben Knoble" <ben.knoble+github@gmail.com>,
	 git@vger.kernel.org,
	"brian m . carlson" <sandals@crustytoothpaste.net>,
	 Patrick Steinhardt <ps@pks.im>,  Taylor Blau <me@ttaylorr.com>,
	 Caleb White <cdwhite3@pm.me>,  Calvin Wan <calvinwan@google.com>,
	 Elijah Newren <newren@gmail.com>,
	 Andrew Berry <andrew@furrypaws.ca>,  Jeff King <peff@peff.net>,
	 Derrick Stolee <stolee@gmail.com>
Subject: Re: [PATCH] dir: use per-worktree repository ignore patterns upon request
Date: Sat, 25 Apr 2026 12:06:34 +0900	[thread overview]
Message-ID: <xmqq7bpvwxfp.fsf@gitster.g> (raw)
In-Reply-To: <4a8d1289-2e2b-4fd6-8ada-143992dd7c4d@gmail.com> (Phillip Wood's message of "Fri, 24 Apr 2026 20:53:31 +0100")

Phillip Wood <phillip.wood123@gmail.com> writes:

> Sharing the same set of exclude patterns between all worktrees seems 
> like a reasonable thing to do - it would be a pain to have to populate 
> them every time a new worktree was created.
>
> 	git rev-parse --git-path info/exclude
>
> always returns the correct path because it uses repo_git_path() which 
> knows whether a particular path is per-worktree or resides under 
> $GIT_COMMON_DIR. It is best to avoid constructing paths manually using 
> "git rev-parse --git-dir"

Great to see the best practice raised, like this.

>> Some users may prefer each worktree use its own ignore file; some may
>> prefer both; some may prefer the current behavior.
>
> This sounds quite hypothetical - do we have a concrete use case for 
> per-worktree exclude files?

I can see if somebody wants to have different subset of paths
checked out by setting up separate sparse settings.  But marking
what paths are never be part of the project (which is what exclude
is about)?  I do not think it is useful in general.

The only case I can think of is a repository that houses more than
one completely unrelated histories, perhaps being cheapster on a
hosting site that charges per number of repositories or something
silly like that.

My https://git.kernel.org/pub/scm/git/git.git/ repository houses two
completely unrelated histories, one the project data, and 'todo'
that are mostly about tools I personally use to maintain the
project.  Ideally, the latter branch should have been created and
maintained as a separate repository, but back them I didn't have
write access outside pub/scm/git/git.git/ (notably pub/scm/git/
itself was not writable to me) and that was the only reason why that
unrelated history is pushed into the same repository as a separate
and unrelated 'todo' branch.  It is not a recommended practice, and
if this configuration is primarily to cater to such layout, I do not
think we want to add it.

  reply	other threads:[~2026-04-25  3:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-24 17:09 [PATCH] dir: use per-worktree repository ignore patterns upon request D. Ben Knoble
2026-04-24 19:35 ` brian m. carlson
2026-04-24 19:53 ` Phillip Wood
2026-04-25  3:06   ` Junio C Hamano [this message]
2026-05-08 14:14 ` [PATCH v2] ignore: note info/exclude lives in GIT_COMMON_DIR, not GIT_DIR D. Ben Knoble
2026-05-09 14:08   ` brian m. carlson
2026-05-11 10:30   ` Phillip Wood
2026-05-11 19:55     ` D. Ben Knoble
2026-05-12 21:21   ` [PATCH v3] " D. Ben Knoble
2026-05-13 14:02     ` Phillip Wood

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=xmqq7bpvwxfp.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=andrew@furrypaws.ca \
    --cc=ben.knoble+github@gmail.com \
    --cc=calvinwan@google.com \
    --cc=cdwhite3@pm.me \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    --cc=newren@gmail.com \
    --cc=peff@peff.net \
    --cc=phillip.wood123@gmail.com \
    --cc=ps@pks.im \
    --cc=sandals@crustytoothpaste.net \
    --cc=stolee@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