From: Will Palmer <wmpalmer@gmail.com>
To: git@vger.kernel.org
Cc: wmpalmer@gmail.com, gitster@pobox.com
Subject: [PATCH/RFC resend] diff-options: make --patch a synonym for -p
Date: Thu, 13 May 2010 09:59:00 +0100 [thread overview]
Message-ID: <1273741140.2516.15.camel@wpalmer.simply-domain> (raw)
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;
next reply other threads:[~2010-05-13 8:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-13 8:59 Will Palmer [this message]
2010-05-13 11:39 ` [PATCH/RFC resend] diff-options: make --patch a synonym for -p Matthieu Moy
2010-05-13 11:45 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1273741140.2516.15.camel@wpalmer.simply-domain \
--to=wmpalmer@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).