From 1ecc1cbd3a7642c4f517d086d7b45d6341172dfe Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 17 Jul 2013 15:05:46 -0700 Subject: diff: preparse --diff-filter string argument Instead of running strchr() on the list of status characters over and over again, parse the --diff-filter option into bitfields and use the bits to see if the change to the filepair matches the status requested. Signed-off-by: Junio C Hamano --- diff.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'diff.h') diff --git a/diff.h b/diff.h index 78b4091dd5..a36720752f 100644 --- a/diff.h +++ b/diff.h @@ -103,12 +103,15 @@ enum diff_words_type { }; struct diff_options { - const char *filter; const char *orderfile; const char *pickaxe; const char *single_follow; const char *a_prefix, *b_prefix; unsigned flags; + + /* diff-filter bits */ + unsigned int filter; + int use_color; int context; int interhunkcontext; -- cgit v1.2.3 From 95a7c546b02a962b9e458f7fd2d0ed9b657c0ca6 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 17 Jul 2013 17:18:32 -0700 Subject: diff: deprecate -q option to diff-files This reimplements the ancient "-q" option to "git diff-files" that was inherited from "show-diff -q" in terms of "--diff-filter=d". We will be deprecating the "-q" option, so let's issue a warning when we do so. Incidentally this also tentatively fixes "git diff --no-index" to honor "-q" and hide deletions; the use will get the same warning. We should remove the support for "-q" in a future version but it is not that urgent. Signed-off-by: Junio C Hamano --- diff.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'diff.h') diff --git a/diff.h b/diff.h index a36720752f..5237d63a71 100644 --- a/diff.h +++ b/diff.h @@ -341,6 +341,8 @@ extern int parse_rename_score(const char **cp_p); extern long parse_algorithm_value(const char *value); +extern void handle_deprecated_show_diff_q(struct diff_options *); + extern int print_stat_summary(FILE *fp, int files, int insertions, int deletions); extern void setup_diff_pager(struct diff_options *); -- cgit v1.2.3