@matheusbsbs / matheus-bagliano / commits / 1c9eecff97
Fork 0

diff-options: make --patch a synonym for -p

Here we simply make --patch a synonym for -p, whose mnemonic was "patch" all along. Signed-off-by: Will Palmer <wmpalmer@gmail.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Will Palmer committed May 13, 2010 at 09:59 UTC 1c9eecff97beab2d425397dc624281dff5c0be5c
2 files changed +2 -1
Documentation/diff-options.txt
+1
@@ -21,6 +21,7 @@ endif::git-format-patch[]
21 ifndef::git-format-patch[]
22 -p::
23 -u::
24 +--patch::
25 Generate patch (see section on generating patches).
26 {git-diff? This is the default.}
27 endif::git-format-patch[]
diff.c
+1 -1
@@ -2701,7 +2701,7 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
2701 const char *arg = av[0];
2702
2703 /* Output format options */
2704 - if (!strcmp(arg, "-p") || !strcmp(arg, "-u"))
2704 + if (!strcmp(arg, "-p") || !strcmp(arg, "-u") || !strcmp(arg, "--patch"))
2705 options->output_format |= DIFF_FORMAT_PATCH;
2706 else if (opt_arg(arg, 'U', "unified", &options->context))
2707 options->output_format |= DIFF_FORMAT_PATCH;