Thread (8 messages) flat view 8 messages, 6 authors, 2016-06-15

Re: [PATCH] Check for -amend as a common wrong usage of --amend.

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:44:08

Hi,

On Thu, 24 Jan 2008, Pascal Obry wrote:
quoted hunk ↗ jump to hunk
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 {
That is ugly.  In a source file which is by no means specific to 
git-commit, you cannot possibly mean to check for "amend".

I don't like it,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help