]> git.ipfire.org Git - thirdparty/git.git/commit - pathspec.c
pathspec: support :(glob) syntax
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sun, 14 Jul 2013 08:36:08 +0000 (15:36 +0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 15 Jul 2013 17:56:10 +0000 (10:56 -0700)
commitbd30c2e48432c692f9e77d3529c9cf25117066bb
tree9b5601d17196c49356adc686ce3c5ae7e62d94cf
parenta16bf9dd745a9e43e46d745d850db49358430e46
pathspec: support :(glob) syntax

:(glob)path differs from plain pathspec that it uses wildmatch with
WM_PATHNAME while the other uses fnmatch without FNM_PATHNAME. The
difference lies in how '*' (and '**') is processed.

With the introduction of :(glob) and :(literal) and their global
options --[no]glob-pathspecs, the user can:

 - make everything literal by default via --noglob-pathspecs
   --literal-pathspecs cannot be used for this purpose as it
   disables _all_ pathspec magic.

 - individually turn on globbing with :(glob)

 - make everything globbing by default via --glob-pathspecs

 - individually turn off globbing with :(literal)

The implication behind this is, there is no way to gain the default
matching behavior (i.e. fnmatch without FNM_PATHNAME). You either get
new globbing or literal. The old fnmatch behavior is considered
deprecated and discouraged to use.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 files changed:
Documentation/git.txt
Documentation/glossary-content.txt
builtin/add.c
builtin/ls-tree.c
cache.h
dir.c
dir.h
git.c
pathspec.c
pathspec.h
t/t6130-pathspec-noglob.sh
tree-walk.c