From: Junio C Hamano <gitster@pobox•com>
To: Karsten Blees <karsten.blees@gmail•com>
Cc: Git List <git@vger•kernel.org>, Jeff King <peff@peff•net>,
Duy Nguyen <pclouds@gmail•com>
Subject: Re: [PATCH 2/2] gitignore.txt: clarify recursive nature of excluded directories
Date: Thu, 07 Nov 2013 10:57:44 -0800 [thread overview]
Message-ID: <xmqqa9hg59av.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <527BC068.3040303@gmail.com> (Karsten Blees's message of "Thu, 07 Nov 2013 17:31:36 +0100")
Karsten Blees <karsten.blees@gmail•com> writes:
> Additionally, precedence of negated patterns is exactly as outlined in
> the DESCRIPTION section, we don't need to repeat this.
Very good, thanks.
Even though I have a suspicion that somebody else may be able to
come up with a better phrase that does not sound unnecessarily
strongly than "recursively and irrevocably", that somebody else is
not me, so I'll queue this as-is for now.
>
> Signed-off-by: Karsten Blees <blees@dcon•de>
> ---
> Documentation/gitignore.txt | 18 ++++++++++++++++--
> 1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt
> index f971960..5ecc48e 100644
> --- a/Documentation/gitignore.txt
> +++ b/Documentation/gitignore.txt
> @@ -79,8 +79,9 @@ PATTERN FORMAT
>
> - An optional prefix "`!`" which negates the pattern; any
> matching file excluded by a previous pattern will become
> - included again. If a negated pattern matches, this will
> - override lower precedence patterns sources.
> + included again. It is not possible to re-include a file if a parent
> + directory of that file is excluded (i.e. excluding a directory
> + will recursively and irrevocably exclude the entire content).
> Put a backslash ("`\`") in front of the first "`!`" for patterns
> that begin with a literal "`!`", for example, "`\!important!.txt`".
>
> @@ -182,6 +183,19 @@ Another example:
> The second .gitignore prevents Git from ignoring
> `arch/foo/kernel/vmlinux.lds.S`.
>
> +Example to exclude everything except a specific directory `foo/bar`
> +(note the `/*` - without the slash, the wildcard would also exclude
> +everything within `foo/bar`):
> +
> +--------------------------------------------------------------
> + $ cat .gitignore
> + # exclude everything except directory foo/bar
> + /*
> + !/foo
> + /foo/*
> + !/foo/bar
> +--------------------------------------------------------------
> +
> SEE ALSO
> --------
> linkgit:git-rm[1],
next prev parent reply other threads:[~2013-11-07 18:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-07 16:30 [PATCH 0/2] Improve gitignore documentation wrt excluded directories Karsten Blees
2013-11-07 16:30 ` [PATCH 1/2] gitignore.txt: fix documentation of "**" patterns Karsten Blees
2013-11-07 18:50 ` Junio C Hamano
2013-11-07 16:31 ` [PATCH 2/2] gitignore.txt: clarify recursive nature of excluded directories Karsten Blees
2013-11-07 18:57 ` Junio C Hamano [this message]
2013-11-07 19:37 ` Junio C Hamano
2013-11-07 19:55 ` Jeff King
2013-11-07 20:27 ` Karsten Blees
2013-11-07 20:57 ` Jeff King
2013-11-07 21:36 ` Karsten Blees
2013-11-07 22:43 ` 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=xmqqa9hg59av.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=karsten.blees@gmail$(echo .)com \
--cc=pclouds@gmail$(echo .)com \
--cc=peff@peff$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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