Skip to content

Commit 1c9eecf

Browse files
wpalmergitster
authored andcommitted
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 <[email protected]> Reviewed-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 67687fe commit 1c9eecf

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Documentation/diff-options.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ endif::git-format-patch[]
2121
ifndef::git-format-patch[]
2222
-p::
2323
-u::
24+
--patch::
2425
Generate patch (see section on generating patches).
2526
{git-diff? This is the default.}
2627
endif::git-format-patch[]

diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2701,7 +2701,7 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
27012701
const char *arg = av[0];
27022702

27032703
/* Output format options */
2704-
if (!strcmp(arg, "-p") || !strcmp(arg, "-u"))
2704+
if (!strcmp(arg, "-p") || !strcmp(arg, "-u") || !strcmp(arg, "--patch"))
27052705
options->output_format |= DIFF_FORMAT_PATCH;
27062706
else if (opt_arg(arg, 'U', "unified", &options->context))
27072707
options->output_format |= DIFF_FORMAT_PATCH;

0 commit comments

Comments
 (0)