git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-commit.sh: Fix usage checks regarding paths given when they do not make sense
@ 2007-11-05 19:36 Björn Steinbrink
  2007-11-05 21:39 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Björn Steinbrink @ 2007-11-05 19:36 UTC (permalink / raw)
  To: gitster; +Cc: paolo.bonzini, krh, git, Björn Steinbrink

The checks that looked for paths given to git-commit in addition to
--all or --interactive expected only 3 values, while the case statement
actually provides 4, so the check was never triggered.

The bug was introduced in 6cbf07efc5702351897dee4742525c9b9f7828ac when
the case statement was extended to handle --interactive.

Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
---
 git-commit.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/git-commit.sh b/git-commit.sh
index fcb8443..d4471ff 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -282,9 +282,9 @@ unset only
 case "$all,$interactive,$also,$#" in
 *t,*t,*)
 	die "Cannot use -a, --interactive or -i at the same time." ;;
-t,,[1-9]*)
+t,,,[1-9]*)
 	die "Paths with -a does not make sense." ;;
-,t,[1-9]*)
+,t,,[1-9]*)
 	die "Paths with --interactive does not make sense." ;;
 ,,t,0)
 	die "No paths with -i does not make sense." ;;
-- 
1.5.3.5.561.g140d-dirty

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

* Re: [PATCH] git-commit.sh: Fix usage checks regarding paths given when they do not make sense
  2007-11-05 19:36 [PATCH] git-commit.sh: Fix usage checks regarding paths given when they do not make sense Björn Steinbrink
@ 2007-11-05 21:39 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2007-11-05 21:39 UTC (permalink / raw)
  To: Björn Steinbrink; +Cc: paolo.bonzini, krh, git

Björn Steinbrink <B.Steinbrink@gmx.de> writes:

> The checks that looked for paths given to git-commit in addition to
> --all or --interactive expected only 3 values, while the case statement
> actually provides 4, so the check was never triggered.
>
> The bug was introduced in 6cbf07efc5702351897dee4742525c9b9f7828ac when
> the case statement was extended to handle --interactive.

Gaah, and thanks.

We really should have "negative" tests to catch this kind of
breakage in our testsuite.  People when inventing new features
are eager to write tests to show off the new stuff works, but
not many people are careful enough to add tests to demonstrate
the commands properly catch user errors such as borked command
line options.

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

end of thread, other threads:[~2007-11-05 21:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-05 19:36 [PATCH] git-commit.sh: Fix usage checks regarding paths given when they do not make sense Björn Steinbrink
2007-11-05 21:39 ` Junio C Hamano

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