diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-01-31 12:17:48 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-02-05 11:46:49 +0300 |
commit | d6b8fc303b389b026f2bf9918f6f83041488989b (patch) | |
tree | d5ae26059837dac6e778e74fccf7b1fdf01eccd0 /Documentation | |
parent | 7a2078b4b00fb1c5d7b0bf8155778f79377b8f2f (diff) |
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.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/gitignore.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt index 08373f52bb..e847b3ba63 100644 --- a/Documentation/gitignore.txt +++ b/Documentation/gitignore.txt @@ -57,6 +57,13 @@ Patterns have the following format: included again. If a negated pattern matches, this will override lower precedence patterns sources. + - If the pattern ends with a slash, it is removed for the + purpose of the following description, but it would only find + a match with a directory. In other words, `foo/` will match a + directory `foo` and paths underneath it, but will not match a + regular file or a symbolic link `foo` (this is consistent + with the way how pathspec works in general in git). + - If the pattern does not contain a slash '/', git treats it as a shell glob pattern and checks for a match against the pathname without leading directories. |