From: Danial Alihosseini <danial.alihosseini@gmail.com>
To: Derrick Stolee <stolee@gmail.com>
Cc: 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 20:36:04 +0330 [thread overview]
Message-ID: <CACLOEFb41ZLvvkaF6xivFShOJfSHcNupzstiShKHiNCg4DCEhQ@mail.gmail.com> (raw)
In-Reply-To: <72fffbff-16f7-fa17-b212-67aae9e1b034@gmail.com>
Thanks Derrick.
> 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".
I think if we consider directory and files separately, it would be more clear.
If a pattern in gitignore matches a directory, it is just about that
directory and not about its contents.
The contents are ignored by another rule which states:
> It is not possible to re-include a file if a parent directory of that file is excluded.
In our test case, the "data1" directory is ignored by the "data/**" pattern.
However, the contents are ignored by two rules. One of them is that
the parent ("data1") is not tracked. Another one is that the "data/**"
pattern matches them.
By adding the "!data/**/" pattern, the "data1" directory is
re-included, but its contents are still ignored by the "data/**"
pattern.
I hope this will help to make the rules more clear.
Thanks
Danial
next prev parent reply other threads:[~2021-11-19 17:06 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 [this message]
2021-11-19 20:05 ` Johannes Sixt
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACLOEFb41ZLvvkaF6xivFShOJfSHcNupzstiShKHiNCg4DCEhQ@mail.gmail.com \
--to=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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).