From: Junio C Hamano <gitster@pobox.com>
To: Tommy Thorn <tommy-git@thorn.ws>
Cc: Linus Torvalds <torvalds@linux-foundation.org>, git@vger.kernel.org
Subject: Re: Bug in .gitignore handling
Date: Wed, 26 Mar 2008 13:49:14 -0700 [thread overview]
Message-ID: <7vd4phcit1.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <47EAB3AD.5070507@thorn.ws> (Tommy Thorn's message of "Wed, 26 Mar 2008 13:35:57 -0700")
Tommy Thorn <tommy-git@thorn.ws> writes:
> Linus Torvalds wrote:
>> On Wed, 26 Mar 2008, Tommy Thorn wrote:
> ...
>> Use "/foo" and it should be ok.
>>
>> Basically, a path with a slash in it is considered absolute, but if
>> the slash is at the end it will only match a directory. A slash at
>> the *beginning* will match the root of the git repository, though.
>
> D'oh, of course that works. I double check the documentation and it
> actually isn't obvious that that is allowed, so I propose this patch.
>
> diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt
> index e847b3b..941a8a4 100644
> --- a/Documentation/gitignore.txt
> +++ b/Documentation/gitignore.txt
> @@ -57,6 +57,9 @@ Patterns have the following format:
> included again. If a negated pattern matches, this will
> override lower precedence patterns sources.
>
> + - If the pattern begins with a slash '/', the pattern will only
> + match in the current directory.
> +
Did you fully read the existing description and Linus's resopnse?
The above is just a special case of a pattern that contains a slash '/'
(iow, that falls into "Otherwise" rule that follows "If the pattern does
not contain a slash '/'").
next prev parent reply other threads:[~2008-03-26 20:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-26 20:01 Bug in .gitignore handling Tommy Thorn
2008-03-26 20:20 ` Junio C Hamano
2008-03-26 20:26 ` Tommy Thorn
2008-03-26 20:27 ` Linus Torvalds
2008-03-26 20:32 ` Linus Torvalds
2008-03-26 20:35 ` Tommy Thorn
2008-03-26 20:49 ` Junio C Hamano [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-03-26 20:27 Eyvind Bernhardsen
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=7vd4phcit1.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=tommy-git@thorn.ws \
--cc=torvalds@linux-foundation.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.