git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Scott R Parish <srp@srparish.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] "git help" and "git help -a" shouldn't exit(1) unless they error
Date: Mon, 22 Oct 2007 01:47:41 -0400	[thread overview]
Message-ID: <20071022054741.GP14735@spearce.org> (raw)
In-Reply-To: <20071021214744.GH16291@srparish.net>

Scott R Parish <srp@srparish.net> wrote:
> diff --git a/help.c b/help.c
> index 1cd33ec..b0d2dd4 100644
> --- a/help.c
> +++ b/help.c
> @@ -204,14 +204,14 @@ int cmd_help(int argc, const char **argv, const char *prefix)
>  	if (!help_cmd) {
>  		printf("usage: %s\n\n", git_usage_string);
>  		list_common_cmds_help();
> -		exit(1);
> +		exit(0);
>  	}

Although it seems simple on the surface this patch breaks the
test suite:

	$ make test
	make -C t/ all
	make[1]: Entering directory `/home/spearce/mygit/t'
	*** t0000-basic.sh ***
	You do not seem to have built git yet.

The issue here is t0000-basic.sh runs "../git" and tests that the
exit status is 1.  If it isn't (the patch above makes it 0) we just
abort the test suite entirely.

I think its correct for "git help" to exit 0, and also for "git
help checkout" or "git checkout --help" to exit 0, but "git" by
itself with no subcommand should exit with an error, it requires a
subcommand to continue.  So some sort of change is needed in git.c
to handle this special no subcommand condition.
  
-- 
Shawn.

  reply	other threads:[~2007-10-22  5:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-21 21:47 [PATCH] "git help" and "git help -a" shouldn't exit(1) unless they error Scott R Parish
2007-10-22  5:47 ` Shawn O. Pearce [this message]
2007-10-22  6:19   ` Scott Parish
2007-10-22  6:37     ` Shawn O. Pearce

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=20071022054741.GP14735@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=srp@srparish.net \
    /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).