git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Check for -amend as a common wrong usage of --amend.
@ 2008-01-24 18:13 Pascal Obry
  2008-01-24 18:16 ` Pascal Obry
  2008-01-24 18:20 ` Johannes Schindelin
  0 siblings, 2 replies; 11+ messages in thread
From: Pascal Obry @ 2008-01-24 18:13 UTC (permalink / raw)
  To: git; +Cc: gitster, Pascal Obry

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-01-26 11:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-24 18:13 [PATCH] Check for -amend as a common wrong usage of --amend Pascal Obry
2008-01-24 18:16 ` Pascal Obry
2008-01-26  0:10   ` Jörg Sommer
2008-01-24 18:20 ` Johannes Schindelin
2008-01-24 18:52   ` Pascal Obry
2008-01-24 19:25     ` Charles Bailey
2008-01-24 19:35       ` Pascal Obry
2008-01-24 20:47     ` Joey Hess
2008-01-26  6:20       ` Junio C Hamano
2008-01-26 10:42         ` Pierre Habouzit
2008-01-26 11:26           ` [PATCH] parse-options: catch some likely in presense of aggregated options Pierre Habouzit

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).