git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Duy Nguyen <pclouds@gmail.com>
To: Jeff King <peff@peff.net>
Cc: AJ <alljeep@gmail.com>, Git Mailing List <git@vger.kernel.org>,
	Jonathan Niedier <jrnieder@gmail.com>
Subject: Re: Feature Request: gitignore recursion
Date: Mon, 7 Oct 2013 20:41:42 +0700	[thread overview]
Message-ID: <20131007134141.GA23026@lanh> (raw)
In-Reply-To: <20131007112411.GA5792@sigill.intra.peff.net>

On Mon, Oct 07, 2013 at 07:24:11AM -0400, Jeff King wrote:
> However, one thing I expected to work but didn't is:
> 
>   echo '*' >.gitignore
>   echo '!*' >my_dir/.gitignore
> 
> That _does_ work for attributes, like:
> 
>   echo '* foo=one' >.gitattributes
>   echo '* foo=two' >my_dir/.gitattributes
> 
> where the more-specific file takes precedence. It works because we keep
> an attribute stack, and look from most-specific directory to least.
>
> ...

Yeah. I'm still bugged about that because we could at least make your
case work (deep/down/.gitignore will never ever, of course) but I
probably won't do anything about it for the next few months. So how
about this.

The first use of footnote:[] is already in git-notes.txt. The second
instance should not cause any issues with supported asciidoc versions.

-- 8< --
Subject: [PATCH] gitignore.txt: note about a behavior not so obvious much to users


Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 Documentation/gitignore.txt | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt
index 54e334e..cd59f6e 100644
--- a/Documentation/gitignore.txt
+++ b/Documentation/gitignore.txt
@@ -21,7 +21,10 @@ Each line in a `gitignore` file specifies a pattern.
 When deciding whether to ignore a path, Git normally checks
 `gitignore` patterns from multiple sources, with the following
 order of precedence, from highest to lowest (within one level of
-precedence, the last matching pattern decides the outcome):
+precedence, the last matching pattern decides the outcome
+footnote:[Due to optimizations Git will not look further into ignored
+directories. So if you have a rule to ignore directory `foo`,
+`.gitignore` in `foo` and its subdirectories are all ignored]):
 
  * Patterns read from the command line for those commands that support
    them.
-- 
1.8.2.83.gc99314b
-- 8< --

  reply	other threads:[~2013-10-07 13:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-06 22:23 Feature Request: gitignore recursion AJ
2013-10-07 10:26 ` Duy Nguyen
2013-10-07 11:24   ` Jeff King
2013-10-07 13:41     ` Duy Nguyen [this message]
2013-10-10  7:59       ` Karsten Blees
2013-10-10 16:22         ` Jeff King
2013-10-10  7:59   ` Karsten Blees

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=20131007134141.GA23026@lanh \
    --to=pclouds@gmail.com \
    --cc=alljeep@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=peff@peff.net \
    /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).