git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adam Piatyszek <ediap@users.sourceforge.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: pradeep singh rautela <rautelap@gmail.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Jeff King <peff@peff.net>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	git@vger.kernel.org
Subject: Re: [PATCH] gitignore(5): Allow "foo/" in ignore list to match directory "foo"
Date: Thu, 31 Jan 2008 23:53:52 +0100	[thread overview]
Message-ID: <47A25180.5000903@users.sourceforge.net> (raw)
In-Reply-To: <7vr6fxbr5a.fsf@gitster.siamese.dyndns.org>

* Junio C Hamano [31 I 2008 22:51]:
> [PATCH] gitignore(5): Allow "foo/" in ignore list to match directory "foo"
> 
> A pattern "foo/" in the exclude list did not match directory
> "foo", but a pattern "foo" did.  This just strips the trailing
> slash from such input.
> 
> This makes the behaviour slightly inconsistent with that of
> pathspecs, where "foo/" only matches directory "foo" and not
> regular file "foo" and make "foo/" in the ignore list match
> regular file "foo" happily.  This may hopefully does not matter
> in practice.
> 
> Signed-off-by: Junio C Hamano <gitster@pobox.com>

This is more or less what I suggested originally. ;-)

Anyway, even if this new behaviour is not consistent with that of 
pathspecs, it is not worse than the current behaviour of git. I.e. now 
you have to use "foo" to ignore the "foo" directory and its contents, 
but it does not protect you from masking the file "foo" in the same 
repository.

However, it is not possible to have both the "foo" directory and "foo" 
file in the same directory level of a repository at the same time. So, 
the problem with this patch might be only when one replaces the ignored 
directory "foo" with a file using the same name and forgets to remove 
the "foo/" entry from .gitignore or .git/info/exclude. But exactly the 
same situation can occur for the current implementation.

So, I tend to agree that your latest patch is a sensible solution for 
99.9% of cases.

BR,
/Adam


-- 
.:.  Adam Piatyszek (ediap)  .:.....................................:.
.:.  ediap@users.sourceforge.net  .:................................:.

  reply	other threads:[~2008-01-31 23:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-23 13:54 Why does git track directory listed in .gitignore/".git/info/exclude"? pradeep singh rautela
2008-01-23 14:04 ` pradeep singh rautela
2008-01-23 21:17   ` Linus Torvalds
2008-01-24 10:44     ` pradeep singh rautela
2008-01-30 12:35     ` Adam Piatyszek
2008-01-30 20:39       ` Junio C Hamano
2008-01-30 21:06         ` Junio C Hamano
2008-01-31  7:05         ` Adam Piatyszek
2008-01-31  8:54           ` *Re: " Junio C Hamano
2008-01-31  9:17             ` [PATCH] gitignore(5): Allow "foo/" in ignore list to match directory "foo" Junio C Hamano
2008-01-31  9:41               ` Jeff King
2008-01-31 10:35                 ` Junio C Hamano
2008-01-31 10:42                   ` Jeff King
2008-01-31 11:38                     ` Johannes Schindelin
2008-01-31 11:56                       ` pradeep singh rautela
2008-01-31 21:51                         ` Junio C Hamano
2008-01-31 22:53                           ` Adam Piatyszek [this message]
2008-02-01  8:56                           ` Andreas Ericsson
2008-01-31 12:29                       ` Adam Piatyszek
2008-01-23 21:11 ` Why does git track directory listed in .gitignore/".git/info/exclude"? Wayne Davison

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=47A25180.5000903@users.sourceforge.net \
    --to=ediap@users.sourceforge.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=rautelap@gmail.com \
    --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 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).