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 <gitster@pobox.com>
This commit is contained in:
@ -86,10 +86,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)
|
||||
@ -136,8 +138,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;
|
||||
@ -203,8 +203,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