Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
diff.c: convert -u|-p|--patch
author
Nguyễn Thái Ngọc Duy
<pclouds@gmail.com>
Sun, 27 Jan 2019 00:35:32 +0000
(07:35 +0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 28 Jan 2019 00:28:18 +0000
(16:28 -0800)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
4a28847
)
diff --git
a/diff.c
b/diff.c
index 80b4af23d71808988b5602d79be1fc9a2694caa9..a4a40e4aa8b38e9850fdf7cd3b3801c4bbb01f64 100644
(file)
--- a/
diff.c
+++ b/
diff.c
@@
-4870,6
+4870,13
@@
static int parse_objfind_opt(struct diff_options *opt, const char *arg)
static void prep_parse_options(struct diff_options *options)
{
struct option parseopts[] = {
static void prep_parse_options(struct diff_options *options)
{
struct option parseopts[] = {
+ OPT_GROUP(N_("Diff output format options")),
+ OPT_BITOP('p', "patch", &options->output_format,
+ N_("generate patch"),
+ DIFF_FORMAT_PATCH, DIFF_FORMAT_NO_OUTPUT),
+ OPT_BITOP('u', NULL, &options->output_format,
+ N_("generate patch"),
+ DIFF_FORMAT_PATCH, DIFF_FORMAT_NO_OUTPUT),
OPT_END()
};
OPT_END()
};
@@
-4898,8
+4905,7
@@
int diff_opt_parse(struct diff_options *options,
return ac;
/* Output format options */
return ac;
/* Output format options */
- if (!strcmp(arg, "-p") || !strcmp(arg, "-u") || !strcmp(arg, "--patch")
- || opt_arg(arg, 'U', "unified", &options->context))
+ if (opt_arg(arg, 'U', "unified", &options->context))
enable_patch_output(&options->output_format);
else if (!strcmp(arg, "--raw"))
options->output_format |= DIFF_FORMAT_RAW;
enable_patch_output(&options->output_format);
else if (!strcmp(arg, "--raw"))
options->output_format |= DIFF_FORMAT_RAW;