From: Diwas Joshi <dj.dij123@gmail.com>
To: git@vger.kernel.org
Cc: Diwas Joshi <dj.dij123@gmail.com>
Subject: [PATCH/GSoC 3/3] Nousage message in error
Date: Thu, 24 Mar 2016 07:33:38 +0530 [thread overview]
Message-ID: <1458785018-29232-1-git-send-email-dj.dij123@gmail.com> (raw)
- 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
next reply other threads:[~2016-03-24 2:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-24 2:03 Diwas Joshi [this message]
2016-03-24 5:14 ` [PATCH/GSoC 3/3] Nousage message in error Pranit Bauva
2016-03-24 16:23 ` Junio C Hamano
2016-03-24 16:28 ` Pranit Bauva
2016-03-24 7:24 ` Pranit Bauva
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1458785018-29232-1-git-send-email-dj.dij123@gmail.com \
--to=dj.dij123@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).