From: Junio C Hamano Date: Fri, 7 Mar 2014 23:17:40 +0000 (-0800) Subject: Merge branch 'jc/hold-diff-remove-q-synonym-for-no-deletion' X-Git-Tag: v2.0.0-rc0~137 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/2687ffdeb76816a1645a5c3e3c7aaf654cc923bc?ds=inline;hp=--cc Merge branch 'jc/hold-diff-remove-q-synonym-for-no-deletion' Remove a confusing and deprecated "-q" option from "git diff-files"; "git diff-files --diff-filter=d" can be used instead. --- 2687ffdeb76816a1645a5c3e3c7aaf654cc923bc diff --cc diff-no-index.c index 33e5982a1c,98a9cf1322..8e10bff30e --- a/diff-no-index.c +++ b/diff-no-index.c @@@ -183,12 -183,41 +183,11 @@@ static int queue_diff(struct diff_optio void diff_no_index(struct rev_info *revs, int argc, const char **argv, - int nongit, const char *prefix) + const char *prefix) { int i, prefixlen; - unsigned deprecated_show_diff_q_option_used = 0; - int no_index = 0; const char *paths[2]; - /* Were we asked to do --no-index explicitly? */ - for (i = 1; i < argc; i++) { - if (!strcmp(argv[i], "--")) { - i++; - break; - } - if (!strcmp(argv[i], "--no-index")) - no_index = 1; - if (argv[i][0] != '-') - break; - } - - if (!no_index && !nongit) { - /* - * Inside a git repository, without --no-index. Only - * when a path outside the repository is given, - * e.g. "git diff /var/tmp/[12]", or "git diff - * Makefile /var/tmp/Makefile", allow it to be used as - * a colourful "diff" replacement. - */ - if ((argc != i + 2) || - (path_inside_repo(prefix, argv[i]) && - path_inside_repo(prefix, argv[i+1]))) - return; - } - if (argc != i + 2) - usagef("git diff %s ", - no_index ? "--no-index" : "[--no-index]"); - diff_setup(&revs->diffopt); for (i = 1; i < argc - 2; ) { int j; diff --cc diff.c index e8006666d8,2d0b5e33f9..7c59bfe2d0 --- a/diff.c +++ b/diff.c @@@ -3599,19 -3570,6 +3599,11 @@@ static int parse_diff_filter_opt(const return 0; } - /* Used only by "diff-files" and "diff --no-index" */ - void handle_deprecated_show_diff_q(struct diff_options *opt) - { - warning("'diff -q' and 'diff-files -q' are deprecated."); - warning("Use 'diff --diff-filter=d' instead to ignore deleted filepairs."); - parse_diff_filter_opt("d", opt); - } - +static void enable_patch_output(int *fmt) { + *fmt &= ~DIFF_FORMAT_NO_OUTPUT; + *fmt |= DIFF_FORMAT_PATCH; +} + int diff_opt_parse(struct diff_options *options, const char **av, int ac) { const char *arg = av[0];