From: Junio C Hamano Date: Wed, 18 Dec 2019 22:02:01 GMT Subject: Re: [PATCH v2 02/18] t7526: add tests for error conditions Message-ID: In-Reply-To: "Alexandr Miloslavskiy via GitGitGadget" writes: > + test_must_fail git commit --pathspec-from-file=- --interactive -m "Commit" err && > + test_i18ngrep "\-\-pathspec-from-file is incompatible with \-\-interactive/\-\-patc h" err && What's with the overly-noisy quoting of dashes here? To match a string that happens to begin with a dash, either one of $ grep -e "-this string begins with and has-many-dashes-in-it" file $ grep "[-]this string begins with and has-many-dashes-in-it" file would be sufficient and more idiomatic. Or am I missing some other reason why the test is written this way? > + test_must_fail git commit --pathspec-from-file=- --patch -m "Commit" err && > + test_i18ngrep "\-\-pathspec-from-file is incompatible with \-\-interactive/\-\-patch" err && > + > + test_must_fail git commit --pathspec-from-file=- -m "Commit" -- fileA.t err && > + test_i18ngrep "\-\-pathspec-from-file is incompatible with pathspec arguments" err && > + > + test_must_fail git commit --pathspec-file-nul -m "Commit" 2>err && > + test_i18ngrep "\-\-pathspec-file-nul requires \-\-pathspec-from-file" err && > + > + test_must_fail git commit --pathspec-from-file=- --include -m "Commit" err && > + test_i18ngrep "No paths with \-\-include/\-\-only does not make sense." err && > + > + test_must_fail git commit --pathspec-from-file=- --only -m "Commit" err && > + test_i18ngrep "No paths with \-\-include/\-\-only does not make sense." err > +' > + > test_done