* [PATCH] Re: .gitignore Bug Report on the behavior of *
2010-09-25 20:03 ` Johannes Sixt
@ 2010-09-25 20:40 ` Seth Robertson
2010-09-25 20:53 ` Ævar Arnfjörð Bjarmason
2010-09-25 23:27 ` Sverre Rabbelier
2 siblings, 0 replies; 5+ messages in thread
From: Seth Robertson @ 2010-09-25 20:40 UTC (permalink / raw)
To: Johannes Sixt; +Cc: git
In message <201009252203.48820.j6t@kdbg.org>, Johannes Sixt writes:
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"?
Hmm. No, not really, but having a .gitignore in a directory which has
tracked git files in it seems somehow different, and at least to me the
documentation of .gitignore suggests a different algorithm. How about
this for a documentation patch?
Signed-off-by: Seth Robertson <in-gitvger@baka.org>
----------------------------------------------------------------------
diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt
index 7dc2e8b..4f825d8 100644
--- a/Documentation/gitignore.txt
+++ b/Documentation/gitignore.txt
@@ -33,6 +33,8 @@ precedence, the last matching pattern decides the outcome):
as the path, or in any parent directory, with patterns in the
higher level files (up to the toplevel of the work tree) being overridden
by those in lower level files down to the directory containing the file.
+ Any pattern causing a directory to be ignored will cause
+ any `.gitignore` file under that dirctory to be ignored.
These patterns match relative to the location of the
`.gitignore` file. A project normally includes such
`.gitignore` files in its repository, containing patterns for
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: .gitignore Bug Report on the behavior of *
2010-09-25 20:03 ` Johannes Sixt
2010-09-25 20:40 ` [PATCH] " Seth Robertson
@ 2010-09-25 20:53 ` Ævar Arnfjörð Bjarmason
2010-09-25 23:27 ` Sverre Rabbelier
2 siblings, 0 replies; 5+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-09-25 20:53 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Seth Robertson, git
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: .gitignore Bug Report on the behavior of *
2010-09-25 20:03 ` Johannes Sixt
2010-09-25 20:40 ` [PATCH] " Seth Robertson
2010-09-25 20:53 ` Ævar Arnfjörð Bjarmason
@ 2010-09-25 23:27 ` Sverre Rabbelier
2 siblings, 0 replies; 5+ messages in thread
From: Sverre Rabbelier @ 2010-09-25 23:27 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Seth Robertson, git
Heya,
<threadjacking rant>
On Sat, Sep 25, 2010 at 22:03, Johannes Sixt <j6t@kdbg.org> wrote:
> 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"?
Yet when I (recursively for all files) 'git update-index
--assume-unchanged some-dir' it will still looking at all the bloody
.gitignore making it slow as moleasses.
</rant>
Of course, the above is an insane setup with a .gitignore file in each
and every directory. But it would be so nice if git Just Worked even
in insane cases!
--
Cheers,
Sverre Rabbelier
^ permalink raw reply [flat|nested] 5+ messages in thread