git-diff-*: support "-u" as a synonym for "-p"
I'm probably not the only one whose fingers have gotten hard-wired to use "-u" for "unified diff".
This commit is contained in:
parent
0acfc97252
commit
acb46f8769
@ -193,7 +193,8 @@ int main(int argc, const char **argv)
|
|||||||
/* We accept the -r flag just to look like git-diff-tree */
|
/* We accept the -r flag just to look like git-diff-tree */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!strcmp(arg, "-p")) {
|
/* We accept the -u flag as a synonym for "-p" */
|
||||||
|
if (!strcmp(arg, "-p") || !strcmp(arg, "-u")) {
|
||||||
diff_output_format = DIFF_FORMAT_PATCH;
|
diff_output_format = DIFF_FORMAT_PATCH;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ int main(int argc, const char **argv)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
while (1 < argc && argv[1][0] == '-') {
|
while (1 < argc && argv[1][0] == '-') {
|
||||||
if (!strcmp(argv[1], "-p"))
|
if (!strcmp(argv[1], "-p") || !strcmp(argv[1], "-u"))
|
||||||
diff_output_format = DIFF_FORMAT_PATCH;
|
diff_output_format = DIFF_FORMAT_PATCH;
|
||||||
else if (!strcmp(argv[1], "-q"))
|
else if (!strcmp(argv[1], "-q"))
|
||||||
silent = 1;
|
silent = 1;
|
||||||
|
@ -438,7 +438,7 @@ int main(int argc, const char **argv)
|
|||||||
diff_setup_opt |= DIFF_SETUP_REVERSE;
|
diff_setup_opt |= DIFF_SETUP_REVERSE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!strcmp(arg, "-p")) {
|
if (!strcmp(arg, "-p") || !strcmp(arg, "-u")) {
|
||||||
diff_output_format = DIFF_FORMAT_PATCH;
|
diff_output_format = DIFF_FORMAT_PATCH;
|
||||||
recursive = 1;
|
recursive = 1;
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user