git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH/RFC] setup: update error message to be more meaningful
@ 2017-07-25 17:57 Kaartic Sivaraam
  2017-07-25 18:16 ` Kaartic Sivaraam
  2017-07-25 21:21 ` Jonathan Nieder
  0 siblings, 2 replies; 15+ messages in thread
From: Kaartic Sivaraam @ 2017-07-25 17:57 UTC (permalink / raw)
  To: git

The error message shown when a flag is found when expecting a
filename wasn't clear as it didn't communicate what was wrong
using the 'suitable' words in *all* cases.

Correct case,

        $ git rev-parse commit.c --flags
        commit.c
        --flags
        fatal: bad flag '--flags' used after filename

Incorrect case,

        $ git grep "test" -n
        fatal: bad flag '-n' used after filename

Change the error message to be general and communicative. This results
in the following output,

        $ git rev-parse commit.c --flags
        commit.c
        --flags
        fatal: found flag '--flags' in place of a filename

        $ git grep "test" -n
        fatal: found flag '-n' in place of a filename

Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
---
 setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.c b/setup.c
index 860507e1fdb2d..0433d7889e6b3 100644
--- a/setup.c
+++ b/setup.c
@@ -230,7 +230,7 @@ void verify_filename(const char *prefix,
 		     int diagnose_misspelt_rev)
 {
 	if (*arg == '-')
-		die("bad flag '%s' used after filename", arg);
+		die("found flag '%s' in place of a filename", arg);
 	if (looks_like_pathspec(arg) || check_filename(prefix, arg))
 		return;
 	die_verify_filename(prefix, arg, diagnose_misspelt_rev);

--
https://github.com/git/git/pull/388

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

end of thread, other threads:[~2017-10-04 14:18 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-25 17:57 [PATCH/RFC] setup: update error message to be more meaningful Kaartic Sivaraam
2017-07-25 18:16 ` Kaartic Sivaraam
2017-07-25 21:21 ` Jonathan Nieder
2017-07-26 13:08   ` Kaartic Sivaraam
2017-07-26 20:09   ` Junio C Hamano
2017-07-29  2:44     ` Kaartic Sivaraam
2017-07-29  3:53       ` Junio C Hamano
2017-07-29 12:13         ` Kaartic Sivaraam
2017-07-29 12:41           ` [PATCH] " Kaartic Sivaraam
2017-07-29 16:10           ` [PATCH/RFC] " Junio C Hamano
2017-07-30 10:47             ` Kaartic Sivaraam
2017-07-30 11:03               ` Kaartic Sivaraam
2017-10-02 17:30     ` [PATCH v2] " Kaartic Sivaraam
2017-10-03  0:32       ` Junio C Hamano
2017-10-04 14:18         ` Kaartic Sivaraam

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).