Merge branch 'sb/diff-blobfind-pickaxe'

"diff" family of commands learned "--find-object=<object-id>" option
to limit the findings to changes that involve the named object.

* sb/diff-blobfind-pickaxe:
  diff: use HAS_MULTI_BITS instead of counting bits manually
  diff: properly error out when combining multiple pickaxe options
  diffcore: add a pickaxe option to find a specific blob
  diff: introduce DIFF_PICKAXE_KINDS_MASK
  diff: migrate diff_flags.pickaxe_ignore_case to a pickaxe_opts bit
  diff.h: make pickaxe_opts an unsigned bit field
This commit is contained in:
Junio C Hamano
2018-01-23 13:16:37 -08:00
8 changed files with 154 additions and 39 deletions

13
diff.h
View File

@ -7,6 +7,7 @@
#include "tree-walk.h"
#include "pathspec.h"
#include "object.h"
#include "oidset.h"
struct rev_info;
struct diff_options;
@ -91,7 +92,6 @@ struct diff_flags {
unsigned override_submodule_config:1;
unsigned dirstat_by_line:1;
unsigned funccontext:1;
unsigned pickaxe_ignore_case:1;
unsigned default_follow_renames:1;
};
@ -146,7 +146,7 @@ struct diff_options {
int skip_stat_unmatch;
int line_termination;
int output_format;
int pickaxe_opts;
unsigned pickaxe_opts;
int rename_score;
int rename_limit;
int needed_rename_limit;
@ -178,6 +178,8 @@ struct diff_options {
enum diff_words_type word_diff;
enum diff_submodule_format submodule_format;
struct oidset *objfind;
/* this is set by diffcore for DIFF_FORMAT_PATCH */
int found_changes;
@ -330,6 +332,13 @@ extern void diff_setup_done(struct diff_options *);
#define DIFF_PICKAXE_KIND_S 4 /* traditional plumbing counter */
#define DIFF_PICKAXE_KIND_G 8 /* grep in the patch */
#define DIFF_PICKAXE_KIND_OBJFIND 16 /* specific object IDs */
#define DIFF_PICKAXE_KINDS_MASK (DIFF_PICKAXE_KIND_S | \
DIFF_PICKAXE_KIND_G | \
DIFF_PICKAXE_KIND_OBJFIND)
#define DIFF_PICKAXE_IGNORE_CASE 32
extern void diffcore_std(struct diff_options *);
extern void diffcore_fix_diff_index(struct diff_options *);