]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jc/hold-diff-remove-q-synonym-for-no-deletion'
authorJunio C Hamano <gitster@pobox.com>
Fri, 7 Mar 2014 23:17:40 +0000 (15:17 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 7 Mar 2014 23:17:41 +0000 (15:17 -0800)
Remove a confusing and deprecated "-q" option from "git diff-files";
"git diff-files --diff-filter=d" can be used instead.

1  2 
diff-lib.c
diff-no-index.c
diff.c
diff.h

diff --cc diff-lib.c
Simple merge
diff --cc diff-no-index.c
index 33e5982a1c61a5726580f40df0a07dadc7e2aaf1,98a9cf1322068b97ad017e2747f3f0f4d313bda7..8e10bff30e5269687e67866c2d3c66d62e3bb883
@@@ -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 <path> <path>",
 -                     no_index ? "--no-index" : "[--no-index]");
 -
        diff_setup(&revs->diffopt);
        for (i = 1; i < argc - 2; ) {
                int j;
diff --cc diff.c
index e8006666d8a528689157aed0e84d23a5477111be,2d0b5e33f93065172f3a85a22ac8ed643089a53e..7c59bfe2d08edd8fe0f13b5487c1af34043d7ef1
--- 1/diff.c
--- 2/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];
diff --cc diff.h
Simple merge