Skip to content

Commit

Permalink
diff-options: make --patch a synonym for -p
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Will Palmer authored and Junio C Hamano committed May 19, 2010
1 parent 67687fe commit 1c9eecf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Documentation/diff-options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ endif::git-format-patch[]
ifndef::git-format-patch[]
-p::
-u::
--patch::
Generate patch (see section on generating patches).
{git-diff? This is the default.}
endif::git-format-patch[]
Expand Down
2 changes: 1 addition & 1 deletion diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -2701,7 +2701,7 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
const char *arg = av[0];

/* Output format options */
if (!strcmp(arg, "-p") || !strcmp(arg, "-u"))
if (!strcmp(arg, "-p") || !strcmp(arg, "-u") || !strcmp(arg, "--patch"))
options->output_format |= DIFF_FORMAT_PATCH;
else if (opt_arg(arg, 'U', "unified", &options->context))
options->output_format |= DIFF_FORMAT_PATCH;
Expand Down

0 comments on commit 1c9eecf

Please sign in to comment.