git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/GSoC 3/3] Nousage message in error
@ 2016-03-24  2:03 Diwas Joshi
  2016-03-24  5:14 ` Pranit Bauva
  2016-03-24  7:24 ` Pranit Bauva
  0 siblings, 2 replies; 5+ messages in thread
From: Diwas Joshi @ 2016-03-24  2:03 UTC (permalink / raw)
  To: git; +Cc: Diwas Joshi

- To show only error text instead of full usage message
- Adds exits to callback function in parse-options-cb.c instead of returning -1 which results in display of usage message.
---
 parse-options-cb.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/parse-options-cb.c b/parse-options-cb.c
index 239898d..b7321d1 100644
--- a/parse-options-cb.c
+++ b/parse-options-cb.c
@@ -85,8 +85,10 @@ int parse_opt_commits(const struct option *opt, const char *arg, int unset)
 
 	if (!arg)
 		return -1;
-	if (get_sha1(arg, sha1))
-		return error("malformed object name %s", arg);
+	if (get_sha1(arg, sha1)) {
+		error("malformed object name %s", arg);
+		exit(129);
+	}
 	commit = lookup_commit_reference(sha1);
 	if (!commit)
 		return error("no such commit %s", arg);
-- 
2.7.4

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

end of thread, other threads:[~2016-03-24 16:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-24  2:03 [PATCH/GSoC 3/3] Nousage message in error Diwas Joshi
2016-03-24  5:14 ` Pranit Bauva
2016-03-24 16:23   ` Junio C Hamano
2016-03-24 16:28     ` Pranit Bauva
2016-03-24  7:24 ` Pranit Bauva

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