* [PATCH/RFC resend] diff-options: make --patch a synonym for -p
@ 2010-05-13 8:59 Will Palmer
2010-05-13 11:39 ` Matthieu Moy
2010-05-13 11:45 ` Jeff King
0 siblings, 2 replies; 3+ messages in thread
From: Will Palmer @ 2010-05-13 8:59 UTC (permalink / raw)
To: git; +Cc: wmpalmer, gitster
Here we simply make --patch a synonym for -p, whose mnemonic was "patch"
all along.
Signed-off-by: Will Palmer <wmpalmer@gmail.com>
---
Re-sending, as this seems to have slipped under the radar last time.
In case a justification is non-obvious: -p has always meant "patch", and the
synonym (-u) has a long-form. I always find myself typing out the long-form
--patch, only to be surprised that it doesn't exist. This patch seeks to
correct what I can only assume was an oversight.
Documentation/diff-options.txt | 1 +
diff.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index c9c6c2b..4a96859 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -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[]
diff --git a/diff.c b/diff.c
index d0ecbc3..8ea9f97 100644
--- a/diff.c
+++ b/diff.c
@@ -2722,7 +2722,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;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH/RFC resend] diff-options: make --patch a synonym for -p
2010-05-13 8:59 [PATCH/RFC resend] diff-options: make --patch a synonym for -p Will Palmer
@ 2010-05-13 11:39 ` Matthieu Moy
2010-05-13 11:45 ` Jeff King
1 sibling, 0 replies; 3+ messages in thread
From: Matthieu Moy @ 2010-05-13 11:39 UTC (permalink / raw)
To: Will Palmer; +Cc: git, gitster
Will Palmer <wmpalmer@gmail.com> writes:
> Re-sending, as this seems to have slipped under the radar last time.
> In case a justification is non-obvious: -p has always meant "patch", and the
> synonym (-u) has a long-form. I always find myself typing out the long-form
> --patch, only to be surprised that it doesn't exist. This patch seeks to
> correct what I can only assume was an oversight.
Agreed. I'll still type -p, but explaining to newbies "git log --patch"
is self-explanatory, while "git log -p" is non-obvious, especially
when it's different from "git -p log"...
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH/RFC resend] diff-options: make --patch a synonym for -p
2010-05-13 8:59 [PATCH/RFC resend] diff-options: make --patch a synonym for -p Will Palmer
2010-05-13 11:39 ` Matthieu Moy
@ 2010-05-13 11:45 ` Jeff King
1 sibling, 0 replies; 3+ messages in thread
From: Jeff King @ 2010-05-13 11:45 UTC (permalink / raw)
To: Will Palmer; +Cc: git, gitster
On Thu, May 13, 2010 at 09:59:00AM +0100, Will Palmer wrote:
> Here we simply make --patch a synonym for -p, whose mnemonic was "patch"
> all along.
Yeah, makes sense to me. We already have --patch-with-stat and
--patch-with-raw (even though they are just historical), so clearly
--patch is the obvious choice.
> Re-sending, as this seems to have slipped under the radar last time.
Junio is incommunicado for a bit. I don't know how able he'll be to comb
through the list once he gets back, so you may need to an eye out and
resend again in a week or so. :)
-Peff
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-05-13 11:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-13 8:59 [PATCH/RFC resend] diff-options: make --patch a synonym for -p Will Palmer
2010-05-13 11:39 ` Matthieu Moy
2010-05-13 11:45 ` Jeff King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).