{"thread":{"id":"10673","subject":"[PATCH] git-commit.sh: Fix usage checks regarding paths given when they do not make sense","startedAt":"2007-11-05T19:36:33Z","lastAt":"2007-11-05T21:39:44Z","messageCount":2,"participants":["Björn Steinbrink","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"58405","messageId":"1194291393-1067-1-git-send-email-B.Steinbrink@gmx.de","threadId":"10673","inReplyTo":null,"subject":"[PATCH] git-commit.sh: Fix usage checks regarding paths given when they do not make sense","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2007-11-05T19:36:33Z","receivedAt":"2007-11-05T19:36:33Z","isPatch":true,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"The checks that looked for paths given to git-commit in addition to\n--all or --interactive expected only 3 values, while the case statement\nactually provides 4, so the check was never triggered.\n\nThe bug was introduced in 6cbf07efc5702351897dee4742525c9b9f7828ac when\nthe case statement was extended to handle --interactive.\n\nSigned-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>\n---\n git-commit.sh |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-commit.sh b/git-commit.sh\nindex fcb8443..d4471ff 100755\n--- a/git-commit.sh\n+++ b/git-commit.sh\n@@ -282,9 +282,9 @@ unset only\n case \"$all,$interactive,$also,$#\" in\n *t,*t,*)\n \tdie \"Cannot use -a, --interactive or -i at the same time.\" ;;\n-t,,[1-9]*)\n+t,,,[1-9]*)\n \tdie \"Paths with -a does not make sense.\" ;;\n-,t,[1-9]*)\n+,t,,[1-9]*)\n \tdie \"Paths with --interactive does not make sense.\" ;;\n ,,t,0)\n \tdie \"No paths with -i does not make sense.\" ;;\n-- \n1.5.3.5.561.g140d-dirty\n"},{"id":"58425","messageId":"7vlk9cnzhb.fsf@gitster.siamese.dyndns.org","threadId":"10673","inReplyTo":"1194291393-1067-1-git-send-email-B.Steinbrink@gmx.de","subject":"Re: [PATCH] git-commit.sh: Fix usage checks regarding paths given when they do not make sense","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-05T21:39:44Z","receivedAt":"2007-11-05T21:39:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Björn Steinbrink <B.Steinbrink@gmx.de> writes:\n\n> The checks that looked for paths given to git-commit in addition to\n> --all or --interactive expected only 3 values, while the case statement\n> actually provides 4, so the check was never triggered.\n>\n> The bug was introduced in 6cbf07efc5702351897dee4742525c9b9f7828ac when\n> the case statement was extended to handle --interactive.\n\nGaah, and thanks.\n\nWe really should have \"negative\" tests to catch this kind of\nbreakage in our testsuite.  People when inventing new features\nare eager to write tests to show off the new stuff works, but\nnot many people are careful enough to add tests to demonstrate\nthe commands properly catch user errors such as borked command\nline options.\n"}]}