Merge branch 'jc/diff-filter-negation'
Teach "git diff --diff-filter" to express "I do not want to see these classes of changes" more directly by listing only the unwanted ones in lowercase (e.g. "--diff-filter=d" will show everything but deletion) and deprecate "diff-files -q" which did the same thing as "--diff-filter=d". * jc/diff-filter-negation: diff: deprecate -q option to diff-files diff: allow lowercase letter to specify what change class to exclude diff: reject unknown change class given to --diff-filter diff: preparse --diff-filter string argument diff: factor out match_filter() diff: pass the whole diff_options to diffcore_apply_filter()
This commit is contained in:
@ -87,10 +87,12 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
|
||||
{
|
||||
int entries, i;
|
||||
int diff_unmerged_stage = revs->max_count;
|
||||
int silent_on_removed = option & DIFF_SILENT_ON_REMOVED;
|
||||
unsigned ce_option = ((option & DIFF_RACY_IS_MODIFIED)
|
||||
? CE_MATCH_RACY_IS_DIRTY : 0);
|
||||
|
||||
if (option & DIFF_SILENT_ON_REMOVED)
|
||||
handle_deprecated_show_diff_q(&revs->diffopt);
|
||||
|
||||
diff_set_mnemonic_prefix(&revs->diffopt, "i/", "w/");
|
||||
|
||||
if (diff_unmerged_stage < 0)
|
||||
@ -137,8 +139,6 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
|
||||
perror(ce->name);
|
||||
continue;
|
||||
}
|
||||
if (silent_on_removed)
|
||||
continue;
|
||||
wt_mode = 0;
|
||||
}
|
||||
dpath->mode = wt_mode;
|
||||
@ -204,8 +204,6 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
|
||||
perror(ce->name);
|
||||
continue;
|
||||
}
|
||||
if (silent_on_removed)
|
||||
continue;
|
||||
diff_addremove(&revs->diffopt, '-', ce->ce_mode,
|
||||
ce->sha1, !is_null_sha1(ce->sha1),
|
||||
ce->name, 0);
|
||||
|
Reference in New Issue
Block a user