git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: Seth Robertson <in-gitvger@baka.org>, git@vger.kernel.org
Subject: Re: .gitignore Bug Report on the behavior of *
Date: Sat, 25 Sep 2010 20:53:57 +0000	[thread overview]
Message-ID: <AANLkTinF2Bk0O96hPiB+WFzWAwEqu=wqdXEnM39+JOoN@mail.gmail.com> (raw)
In-Reply-To: <201009252203.48820.j6t@kdbg.org>

On Sat, Sep 25, 2010 at 20:03, Johannes Sixt <j6t@kdbg.org> wrote:
> On Samstag, 25. September 2010, Seth Robertson wrote:
>> # Properly shows X and B/XX as untracked, as I expected
>> echo X > X; echo XX > B/XX; git status
>>
>> # I expected B/XX to show up as untracked
>> rm -f .gitignore B/.gitignore
>> echo '*' > .gitignore; echo '!*' > B/.gitignore; git status
>
> You should update your expectations to match what you got. ;-)
>
> To show why your expectations are wrong, consider a *huge* and *deep*
> directory with thousands and thousands of subdirectories, call it "usr", that
> should be ignored. The .gitignore at the top-level would just say:
>
>  /usr
>
> Do you really expect git to walk down this ignored directory, just to make
> double-sure that really, really down there does nowhere exist a .gitignore
> that says "oh, wait, don't ignore *this* file"?

That wouldn't be so expensive if the expectation that the .gitignore
in /usr would only be considered if it had already been commited. Then
we'd just have to check if we have a tree for /usr, and whether
there's a gitignore there.

But doing this in the top-level .gitignore if possible is the best
solution.

  parent reply	other threads:[~2010-09-25 20:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-25 19:23 .gitignore Bug Report on the behavior of * Seth Robertson
2010-09-25 20:03 ` Johannes Sixt
2010-09-25 20:40   ` [PATCH] " Seth Robertson
2010-09-25 20:53   ` Ævar Arnfjörð Bjarmason [this message]
2010-09-25 23:27   ` Sverre Rabbelier

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='AANLkTinF2Bk0O96hPiB+WFzWAwEqu=wqdXEnM39+JOoN@mail.gmail.com' \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=in-gitvger@baka.org \
    --cc=j6t@kdbg.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).