From: Johannes Sixt <j6t@kdbg.org>
To: Derrick Stolee <stolee@gmail.com>
Cc: Danial Alihosseini <danial.alihosseini@gmail.com>,
Jeff King <peff@peff.net>, Derrick Stolee <dstolee@microsoft.com>,
git@vger.kernel.org
Subject: Re: git 2.34.0: Behavior of `**` in gitignore is different from previous versions.
Date: Fri, 19 Nov 2021 21:05:40 +0100 [thread overview]
Message-ID: <190a1fea-124d-2e85-38ea-9dab87f3e377@kdbg.org> (raw)
In-Reply-To: <72fffbff-16f7-fa17-b212-67aae9e1b034@gmail.com>
Am 19.11.21 um 15:51 schrieb Derrick Stolee:
> What is unclear to me is what exactly "match a directory" means.
> If we ignore a directory, then we ignore everything inside it (until
> another pattern says we should care about it), but the converse
> should also hold: if we have a pattern like "!data/**/", then that
> should mean "include everything inside data/<A>/ where <A> is any
> directory name".
>
> My inability to form a mental model where the existing behavior
> matches the documented specification is an indicator that this was
> changed erroneously. A revert patch is included at the end of this
> message.
>
> If anyone could help clarify my understanding here, then maybe
> there is room for improving the documentation.
You form a wrong mental model when you start with the grand picture of a
working tree. That is, when you say
- here I have theeeeeese many files and directories,
- and I want to ignore some: foo/**/,
- but I don't want to ignore others: !bar/**/.
This forms the wrong mental model because that is not how Git sees the
working tree: it never has a grand picture of all of its contents.
Git only ever sees the contents of one directory. When Git determines
that a sub-directory is ignored, then that one's contents are never
inspected, and there is no opportunity to un-ignore some of the
sub-directory's contents.
-- Hannes
next prev parent reply other threads:[~2021-11-19 20:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-18 16:41 git 2.34.0: Behavior of `**` in gitignore is different from previous versions Danial Alihosseini
2021-11-18 17:04 ` Jeff King
2021-11-18 22:09 ` Derrick Stolee
2021-11-19 4:01 ` Danial Alihosseini
2021-11-19 14:51 ` Derrick Stolee
2021-11-19 17:06 ` Danial Alihosseini
2021-11-19 20:05 ` Johannes Sixt [this message]
2021-11-19 20:33 ` Derrick Stolee
2021-11-19 20:57 ` Ævar Arnfjörð Bjarmason
2021-11-20 22:41 ` Chris Torek
2021-11-21 0:46 ` Junio C Hamano
2021-11-23 12:21 ` Philip Oakley
2021-11-23 21:13 ` Danial Alihosseini
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=190a1fea-124d-2e85-38ea-9dab87f3e377@kdbg.org \
--to=j6t@kdbg.org \
--cc=danial.alihosseini@gmail.com \
--cc=dstolee@microsoft.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.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;
as well as URLs for NNTP newsgroup(s).