All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Ericsson <ae@op5.se>
To: Boaz Harrosh <bharrosh@panasas.com>
Cc: Dmitry Potapov <dpotapov@gmail.com>,
	mwolfe38 <mwolfe38@gmail.com>,
	git@vger.kernel.org
Subject: Re: ignoring files/directories in git
Date: Mon, 22 Sep 2008 13:53:45 +0200	[thread overview]
Message-ID: <48D78749.3030509@op5.se> (raw)
In-Reply-To: <48D77643.1090908@panasas.com>

Boaz Harrosh wrote:
> Dmitry Potapov wrote:
>> On Mon, Sep 22, 2008 at 10:37:00AM +0300, Boaz Harrosh wrote:
>>> I have 1.6.0.1 I compiled here, and it has the same problem. So it is
>>> a very recent fix
>> I certainly tested 1.6.0.1 and does not have this problem, and it was
>> fixed a long time ago:
>>
>> ===
>> commit d6b8fc303b389b026f2bf9918f6f83041488989b
>> Author: Junio C Hamano <gitster@pobox.com>
>> Date:   Thu Jan 31 01:17:48 2008 -0800
>>
>>     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 attempts to extend the
>>     exclude mechanism so that it would while not matching a regular
>>     file or a symbolic link "foo".  In order to differentiate a
>>     directory and non directory, this passes down the type of path
>>     being checked to excluded() function.
>>
>>     A downside is that the recursive directory walk may need to run
>>     lstat(2) more often on systems whose "struct dirent" do not give
>>     the type of the entry; earlier it did not have to do so for an
>>     excluded path, but we now need to figure out if a path is a
>>     directory before deciding to exclude it.  This is especially bad
>>     because an idea similar to the earlier CE_UPTODATE optimization
>>     to reduce number of lstat(2) calls would by definition not apply
>>     to the codepaths involved, as (1) directories will not be
>>     registered in the index, and (2) excluded paths will not be in
>>     the index anyway.
>> ===
>>
>> The patch is included in 1.5.5.
>>
>> Dmitry
>> --
> 
> Ok I found it. Regular subdirectories it works as you said,
> but soft-link to a folder does not. Sorry for the noise i didn't
> realize that in my test it was a simlink and not a full directory.
> 
> Please don't fix it if it will hurt performance, I'm happy with
> current solution as it is. Just maybe a small addition to the
> .gitignore documentation perhaps.
> 

It wouldn't hurt performance (noticeably) to change the lstat()
call to a stat() call. It's slightly more work for the kernel,
but assuming you don't have tens of thousands of symlinks it
really won't make a difference. I'm not sure what other things
would break from using stat() instead of lstat() in the exclude
matching code though, so it's not so simple as just replacing
it.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

  reply	other threads:[~2008-09-22 11:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-21 16:54 ignoring files/directories in git mwolfe38
2008-09-21 17:19 ` Boaz Harrosh
2008-09-21 17:20 ` Alex Riesen
2008-09-21 17:42 ` mwolfe38
2008-09-22 18:47   ` Tim Harper
2008-09-21 17:42 ` Dmitry Potapov
2008-09-22  0:06 ` mwolfe38
2008-09-22  7:37   ` Boaz Harrosh
2008-09-22  8:52     ` Dmitry Potapov
2008-09-22 10:41       ` Boaz Harrosh
2008-09-22 11:53         ` Andreas Ericsson [this message]
2008-09-22 12:19         ` Dmitry Potapov

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=48D78749.3030509@op5.se \
    --to=ae@op5.se \
    --cc=bharrosh@panasas.com \
    --cc=dpotapov@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=mwolfe38@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.
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.