From: Junio C Hamano Date: Sun, 6 Jan 2013 07:40:15 +0000 (-0800) Subject: Merge branch 'nd/pathspec-wildcard' X-Git-Tag: v1.8.2-rc0~188 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/990a4fea96983d54c0dcc96352e4c86404eceb77?ds=inline;hp=-c Merge branch 'nd/pathspec-wildcard' Optimize matching paths with common forms of pathspecs that contain wildcard characters. * nd/pathspec-wildcard: tree_entry_interesting: do basedir compare on wildcard patterns when possible pathspec: apply "*.c" optimization from exclude pathspec: do exact comparison on the leading non-wildcard part pathspec: save the non-wildcard length part --- 990a4fea96983d54c0dcc96352e4c86404eceb77 diff --combined cache.h index 2b192d24ac,babf9e54c9..843689b68f --- a/cache.h +++ b/cache.h @@@ -473,6 -473,8 +473,8 @@@ extern int index_name_is_other(const st extern int ie_match_stat(const struct index_state *, struct cache_entry *, struct stat *, unsigned int); extern int ie_modified(const struct index_state *, struct cache_entry *, struct stat *, unsigned int); + #define PATHSPEC_ONESTAR 1 /* the pathspec pattern sastisfies GFNM_ONESTAR */ + struct pathspec { const char **raw; /* get_pathspec() result, not freed by free_pathspec() */ int nr; @@@ -482,7 -484,8 +484,8 @@@ struct pathspec_item { const char *match; int len; - unsigned int use_wildcard:1; + int nowildcard_len; + int flags; } *items; }; @@@ -714,11 -717,10 +717,11 @@@ static inline int is_absolute_path(cons } int is_directory(const char *); const char *real_path(const char *path); +const char *real_path_if_valid(const char *path); const char *absolute_path(const char *path); const char *relative_path(const char *abs, const char *base); int normalize_path_copy(char *dst, const char *src); -int longest_ancestor_length(const char *path, const char *prefix_list); +int longest_ancestor_length(const char *path, struct string_list *prefixes); char *strip_path_suffix(const char *path, const char *suffix); int daemon_avoid_alias(const char *path); int offset_1st_component(const char *path); @@@ -1150,8 -1152,11 +1153,8 @@@ struct config_include_data #define CONFIG_INCLUDE_INIT { 0 } extern int git_config_include(const char *name, const char *value, void *data); -#define IDENT_NAME_GIVEN 01 -#define IDENT_MAIL_GIVEN 02 -#define IDENT_ALL_GIVEN (IDENT_NAME_GIVEN|IDENT_MAIL_GIVEN) -extern int user_ident_explicitly_given; -extern int user_ident_sufficiently_given(void); +extern int committer_ident_sufficiently_given(void); +extern int author_ident_sufficiently_given(void); extern const char *git_commit_encoding; extern const char *git_log_output_encoding;