{"thread":{"id":"46967","subject":"[PATCH v2 1/2] diff: alias -q to --quiet","startedAt":"2017-10-13T19:49:37Z","lastAt":"2017-10-13T19:49:39Z","messageCount":2,"participants":["Anthony Sottile"],"isPatch":true,"patchVersion":2,"patchTotal":2},"messages":[{"id":"330378","messageId":"20171013194916.4617-1-asottile@umich.edu","threadId":"46967","inReplyTo":null,"subject":"[PATCH v2 1/2] diff: alias -q to --quiet","fromName":"Anthony Sottile","fromEmail":"asottile@umich.edu","sentAt":"2017-10-13T19:49:15Z","receivedAt":"2017-10-13T19:49:37Z","isPatch":true,"sender":{"key":"asottile@umich.edu","avatar":"https://avatars.githubusercontent.com/u/1810591?v=4"},"body":"Previously, `-q` was silently ignored:\n\nBefore:\n\n$ git diff -q -- Documentation/; echo $?\ndiff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\nindex a88c767..aa6e724 100644\n--- a/Documentation/diff-options.txt\n+++ b/Documentation/diff-options.txt\n@@ -587,6 +587,7 @@ ifndef::git-log[]\n        That is, it exits with 1 if there were differences and\n        0 means no differences.\n\n+-q::\n --quiet::\n        Disable all output of the program. Implies `--exit-code`.\n endif::git-log[]\n0\n$\n\nAfter:\n$ ./git diff -q -- Documentation/; echo $?\n1\n$\n\nSigned-off-by: Anthony Sottile <asottile@umich.edu>\n---\n Documentation/diff-options.txt | 1 +\n diff.c                         | 2 +-\n 2 files changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\nindex a88c767..aa6e724 100644\n--- a/Documentation/diff-options.txt\n+++ b/Documentation/diff-options.txt\n@@ -587,6 +587,7 @@ ifndef::git-log[]\n \tThat is, it exits with 1 if there were differences and\n \t0 means no differences.\n \n+-q::\n --quiet::\n \tDisable all output of the program. Implies `--exit-code`.\n endif::git-log[]\ndiff --git a/diff.c b/diff.c\nindex 69f0357..13dfc3e 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -4751,7 +4751,7 @@ int diff_opt_parse(struct diff_options *options,\n \t}\n \telse if (!strcmp(arg, \"--exit-code\"))\n \t\tDIFF_OPT_SET(options, EXIT_WITH_STATUS);\n-\telse if (!strcmp(arg, \"--quiet\"))\n+\telse if (!strcmp(arg, \"-q\") || !strcmp(arg, \"--quiet\"))\n \t\tDIFF_OPT_SET(options, QUICK);\n \telse if (!strcmp(arg, \"--ext-diff\"))\n \t\tDIFF_OPT_SET(options, ALLOW_EXTERNAL);\n-- \n2.7.4\n\n"},{"id":"330379","messageId":"20171013194916.4617-2-asottile@umich.edu","threadId":"46967","inReplyTo":"20171013194916.4617-1-asottile@umich.edu","subject":"[PATCH v2 2/2] diff: finish removal of deprecated -q option","fromName":"Anthony Sottile","fromEmail":"asottile@umich.edu","sentAt":"2017-10-13T19:49:16Z","receivedAt":"2017-10-13T19:49:39Z","isPatch":true,"sender":{"key":"asottile@umich.edu","avatar":"https://avatars.githubusercontent.com/u/1810591?v=4"},"body":"Functionality was removed in c48f6816f0 but the cli option was not removed.\n\nSigned-off-by: Anthony Sottile <asottile@umich.edu>\n---\n builtin/diff-files.c | 2 --\n builtin/diff.c       | 2 --\n diff.h               | 4 +---\n 3 files changed, 1 insertion(+), 7 deletions(-)\n\ndiff --git a/builtin/diff-files.c b/builtin/diff-files.c\nindex e88493f..b0ff251 100644\n--- a/builtin/diff-files.c\n+++ b/builtin/diff-files.c\n@@ -37,8 +37,6 @@ int cmd_diff_files(int argc, const char **argv, const char *prefix)\n \t\t\trev.max_count = 2;\n \t\telse if (!strcmp(argv[1], \"--theirs\"))\n \t\t\trev.max_count = 3;\n-\t\telse if (!strcmp(argv[1], \"-q\"))\n-\t\t\toptions |= DIFF_SILENT_ON_REMOVED;\n \t\telse\n \t\t\tusage(diff_files_usage);\n \t\targv++; argc--;\ndiff --git a/builtin/diff.c b/builtin/diff.c\nindex f5bbd4d..96513e8 100644\n--- a/builtin/diff.c\n+++ b/builtin/diff.c\n@@ -227,8 +227,6 @@ static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv\n \t\t\trevs->max_count = 2;\n \t\telse if (!strcmp(argv[1], \"--theirs\"))\n \t\t\trevs->max_count = 3;\n-\t\telse if (!strcmp(argv[1], \"-q\"))\n-\t\t\toptions |= DIFF_SILENT_ON_REMOVED;\n \t\telse if (!strcmp(argv[1], \"-h\"))\n \t\t\tusage(builtin_diff_usage);\n \t\telse\ndiff --git a/diff.h b/diff.h\nindex aca150b..c9d71e1 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -65,7 +65,7 @@ typedef struct strbuf *(*diff_prefix_fn_t)(struct diff_options *opt, void *data)\n #define DIFF_OPT_BINARY              (1 <<  2)\n #define DIFF_OPT_TEXT                (1 <<  3)\n #define DIFF_OPT_FULL_INDEX          (1 <<  4)\n-#define DIFF_OPT_SILENT_ON_REMOVE    (1 <<  5)\n+/* (1 << 5) unused */\n #define DIFF_OPT_FIND_COPIES_HARDER  (1 <<  6)\n #define DIFF_OPT_FOLLOW_RENAMES      (1 <<  7)\n #define DIFF_OPT_RENAME_EMPTY        (1 <<  8)\n@@ -374,8 +374,6 @@ extern void diff_warn_rename_limit(const char *varname, int needed, int degraded\n  */\n extern const char *diff_aligned_abbrev(const struct object_id *sha1, int);\n \n-/* do not report anything on removed paths */\n-#define DIFF_SILENT_ON_REMOVED 01\n /* report racily-clean paths as modified */\n #define DIFF_RACY_IS_MODIFIED 02\n extern int run_diff_files(struct rev_info *revs, unsigned int option);\n-- \n2.7.4\n\n"}]}