From: Junio C Hamano Date: Thu, 10 Jan 2013 21:47:15 +0000 (-0800) Subject: Merge branch 'nd/wildmatch' X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2adf7247ec1f82032f52682918c200716145bffd;p=git.git Merge branch 'nd/wildmatch' Allows pathname patterns in .gitignore and .gitattributes files with double-asterisks "foo/**/bar" to match any number of directory hierarchies. * nd/wildmatch: wildmatch: replace variable 'special' with better named ones compat/fnmatch: respect NO_FNMATCH* even on glibc wildmatch: fix "**" special case t3070: Disable some failing fnmatch tests test-wildmatch: avoid Windows path mangling Support "**" wildcard in .gitignore and .gitattributes wildmatch: make /**/ match zero or more directories wildmatch: adjust "**" behavior wildmatch: fix case-insensitive matching wildmatch: remove static variable force_lower_case wildmatch: make wildmatch's return value compatible with fnmatch t3070: disable unreliable fnmatch tests Integrate wildmatch to git wildmatch: follow Git's coding convention wildmatch: remove unnecessary functions Import wildmatch from rsync ctype: support iscntrl, ispunct, isxdigit and isprint ctype: make sane_ctype[] const array Conflicts: Makefile --- 2adf7247ec1f82032f52682918c200716145bffd diff --cc .gitignore index 8e8dc275d,1153a4bb3..aa258a6bc --- a/.gitignore +++ b/.gitignore @@@ -194,9 -191,9 +194,10 @@@ /test-run-command /test-sha1 /test-sigchain +/test-string-list /test-subprocess /test-svn-fe + /test-wildmatch /common-cmds.h *.tar.gz *.dsc diff --cc Makefile index cd0664acc,bc868d154..f37fb240c --- a/Makefile +++ b/Makefile @@@ -529,9 -501,9 +529,10 @@@ TEST_PROGRAMS_NEED_X += test-run-comman TEST_PROGRAMS_NEED_X += test-scrap-cache-tree TEST_PROGRAMS_NEED_X += test-sha1 TEST_PROGRAMS_NEED_X += test-sigchain +TEST_PROGRAMS_NEED_X += test-string-list TEST_PROGRAMS_NEED_X += test-subprocess TEST_PROGRAMS_NEED_X += test-svn-fe + TEST_PROGRAMS_NEED_X += test-wildmatch TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X)) @@@ -703,8 -675,7 +704,9 @@@ LIB_H += url. LIB_H += userdiff.h LIB_H += utf8.h LIB_H += varint.h +LIB_H += walker.h + LIB_H += wildmatch.h +LIB_H += wt-status.h LIB_H += xdiff-interface.h LIB_H += xdiff/xdiff.h @@@ -836,8 -804,8 +838,9 @@@ LIB_OBJS += usage. LIB_OBJS += userdiff.o LIB_OBJS += utf8.o LIB_OBJS += varint.o +LIB_OBJS += version.o LIB_OBJS += walker.o + LIB_OBJS += wildmatch.o LIB_OBJS += wrapper.o LIB_OBJS += write_or_die.o LIB_OBJS += ws.o diff --cc git-compat-util.h index 2cecf56eb,02f48f653..e5a4b7450 --- a/git-compat-util.h +++ b/git-compat-util.h @@@ -528,7 -470,11 +528,11 @@@ extern const char tolower_trans_tbl[256 #undef isupper #undef tolower #undef toupper - extern unsigned char sane_ctype[256]; + #undef iscntrl + #undef ispunct + #undef isxdigit -#undef isprint ++ + extern const unsigned char sane_ctype[256]; #define GIT_SPACE 0x01 #define GIT_DIGIT 0x02 #define GIT_ALPHA 0x04 @@@ -546,6 -493,13 +552,10 @@@ #define isupper(x) sane_iscase(x, 0) #define is_glob_special(x) sane_istest(x,GIT_GLOB_SPECIAL) #define is_regex_special(x) sane_istest(x,GIT_GLOB_SPECIAL | GIT_REGEX_SPECIAL) + #define iscntrl(x) (sane_istest(x,GIT_CNTRL)) + #define ispunct(x) sane_istest(x, GIT_PUNCT | GIT_REGEX_SPECIAL | \ + GIT_GLOB_SPECIAL | GIT_PATHSPEC_MAGIC) + #define isxdigit(x) (hexval_table[x] != -1) -#define isprint(x) (sane_istest(x, GIT_ALPHA | GIT_DIGIT | GIT_SPACE | \ - GIT_PUNCT | GIT_REGEX_SPECIAL | GIT_GLOB_SPECIAL | \ - GIT_PATHSPEC_MAGIC)) #define tolower(x) sane_case((unsigned char)(x), 0x20) #define toupper(x) sane_case((unsigned char)(x), 0) #define is_pathspec_magic(x) sane_istest(x,GIT_PATHSPEC_MAGIC)