[PATCH] Check for -amend as a common wrong usage of --amend.
- From
Pascal Obry <pascal.obry@gmail.com>
- Date
- Jan 24, 2008, 18:13 UTC
- Message-ID
- <1201198439-3516-1-git-send-email-pascal@obry.net>
It happens from time to time to type -amend (with a single dash) when --amend is meant. In those case there is no mistake and git commit all files modified with the log message set to "end". As -amend is just doing something stupid it is better to check for this wrong usage and give hint to the user about the possible mistake.
Signed-off-by: Pascal Obry <pascal@obry.net> --- parse-options.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/parse-options.c b/parse-options.c index 7a08a0c..248515d 100644 --- a/parse-options.c +++ b/parse-options.c @@ -233,6 +233,13 @@ int parse_options(int argc, const char **argv, const struct option *options, continue; } + if (!strcmp(arg + 1, "amend")) { + error("-amend looks suspicious, don't you meant --amend\n"); + args.argc--; + args.argv++; + break; + } + if (arg[1] != '-') { args.opt = arg + 1; do {
-- 1.5.4.rc4.23.gcab31