{"thread":{"id":"10404","subject":"[PATCH] \"git help\" and \"git help -a\" shouldn't exit(1) unless they error","startedAt":"2007-10-21T21:47:45Z","lastAt":"2007-10-22T06:37:37Z","messageCount":4,"participants":["Scott R Parish","Shawn O. Pearce","Scott Parish"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"56779","messageId":"20071021214744.GH16291@srparish.net","threadId":"10404","inReplyTo":null,"subject":"[PATCH] \"git help\" and \"git help -a\" shouldn't exit(1) unless they error","fromName":"Scott R Parish","fromEmail":"srp@srparish.net","sentAt":"2007-10-21T21:47:45Z","receivedAt":"2007-10-21T21:47:45Z","isPatch":true,"sender":{"key":"srp@srparish.net","avatar":"https://gravatar.com/avatar/870e5b6fc4f710cf4db5684bd9af7f2cee5734b3dab3209b13e00cf64f6c9f0e?d=mp&s=160"},"body":"Signed-off-by: Scott R Parish <srp@srparish.net>\n---\n help.c |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/help.c b/help.c\nindex 1cd33ec..b0d2dd4 100644\n--- a/help.c\n+++ b/help.c\n@@ -204,14 +204,14 @@ int cmd_help(int argc, const char **argv, const char *prefix)\n \tif (!help_cmd) {\n \t\tprintf(\"usage: %s\\n\\n\", git_usage_string);\n \t\tlist_common_cmds_help();\n-\t\texit(1);\n+\t\texit(0);\n \t}\n \n \telse if (!strcmp(help_cmd, \"--all\") || !strcmp(help_cmd, \"-a\")) {\n \t\tprintf(\"usage: %s\\n\\n\", git_usage_string);\n \t\tif(exec_path)\n \t\t\tlist_commands(exec_path, \"git-*\");\n-\t\texit(1);\n+\t\texit(0);\n \t}\n \n \telse\n-- \n1.5.3.4.209.g5d1ce-dirty\n"},{"id":"56818","messageId":"20071022054741.GP14735@spearce.org","threadId":"10404","inReplyTo":"20071021214744.GH16291@srparish.net","subject":"Re: [PATCH] \"git help\" and \"git help -a\" shouldn't exit(1) unless they error","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-10-22T05:47:41Z","receivedAt":"2007-10-22T05:47:41Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Scott R Parish <srp@srparish.net> wrote:\n> diff --git a/help.c b/help.c\n> index 1cd33ec..b0d2dd4 100644\n> --- a/help.c\n> +++ b/help.c\n> @@ -204,14 +204,14 @@ int cmd_help(int argc, const char **argv, const char *prefix)\n>  \tif (!help_cmd) {\n>  \t\tprintf(\"usage: %s\\n\\n\", git_usage_string);\n>  \t\tlist_common_cmds_help();\n> -\t\texit(1);\n> +\t\texit(0);\n>  \t}\n\nAlthough it seems simple on the surface this patch breaks the\ntest suite:\n\n\t$ make test\n\tmake -C t/ all\n\tmake[1]: Entering directory `/home/spearce/mygit/t'\n\t*** t0000-basic.sh ***\n\tYou do not seem to have built git yet.\n\nThe issue here is t0000-basic.sh runs \"../git\" and tests that the\nexit status is 1.  If it isn't (the patch above makes it 0) we just\nabort the test suite entirely.\n\nI think its correct for \"git help\" to exit 0, and also for \"git\nhelp checkout\" or \"git checkout --help\" to exit 0, but \"git\" by\nitself with no subcommand should exit with an error, it requires a\nsubcommand to continue.  So some sort of change is needed in git.c\nto handle this special no subcommand condition.\n  \n-- \nShawn.\n"},{"id":"56822","messageId":"20071022061918.GM16291@srparish.net","threadId":"10404","inReplyTo":"20071022054741.GP14735@spearce.org","subject":"Re: [PATCH] \"git help\" and \"git help -a\" shouldn't exit(1) unless they error","fromName":"Scott Parish","fromEmail":"srp@srparish.net","sentAt":"2007-10-22T06:19:19Z","receivedAt":"2007-10-22T06:19:19Z","isPatch":true,"sender":{"key":"srp@srparish.net","avatar":"https://gravatar.com/avatar/870e5b6fc4f710cf4db5684bd9af7f2cee5734b3dab3209b13e00cf64f6c9f0e?d=mp&s=160"},"body":"On Mon, Oct 22, 2007 at 01:47:41AM -0400, Shawn O. Pearce wrote:\n\n> The issue here is t0000-basic.sh runs \"../git\" and tests that the\n> exit status is 1.  If it isn't (the patch above makes it 0) we just\n> abort the test suite entirely.\n\nShoot, i hadn't realized i had effected the \"git\" case. I'll\nlook into this further.\n\nBy the way, should i expect all the tests to pass from the unmodified\npublic HEAD? (they don't for me)\n\nsRp\n\n-- \nScott Parish\nhttp://srparish.net/\n"},{"id":"56825","messageId":"20071022063737.GT14735@spearce.org","threadId":"10404","inReplyTo":"20071022061918.GM16291@srparish.net","subject":"Re: [PATCH] \"git help\" and \"git help -a\" shouldn't exit(1) unless they error","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-10-22T06:37:37Z","receivedAt":"2007-10-22T06:37:37Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Scott Parish <sRp@srparish.net> wrote:\n> On Mon, Oct 22, 2007 at 01:47:41AM -0400, Shawn O. Pearce wrote:\n> \n> > The issue here is t0000-basic.sh runs \"../git\" and tests that the\n> > exit status is 1.  If it isn't (the patch above makes it 0) we just\n> > abort the test suite entirely.\n> \n> Shoot, i hadn't realized i had effected the \"git\" case. I'll\n> look into this further.\n> \n> By the way, should i expect all the tests to pass from the unmodified\n> public HEAD? (they don't for me)\n\nYes.  I only push maint, master and next if they pass all tests.\nIf something doesn't pass I rewind the branch until it does (of\ncourse I only rewind back to what I've previously published).\n\nI do however push a broken pu.  Because individual topics in there\nmay be valid, but one or two may also be broken.  The pu branch\nis meant to be a place to obtain a specific topic of interest\nfrom so you can work further on it, or test it.  Like tonight.\npu compiles but doesn't pass the tests.\n\nSo if you are seeing one or more tests fail please go run that\nspecific test(s) with \"-i -v\" and either come up with a fix for\nthe test, or at least post the output of that to the mailing\nlist so someone else can have a chance to resolve the problem.\n\nSince everything passes here for me on Linux/x86_64 I'm guessing\nits a platform specific issue.  We still should fix it.\n\n-- \nShawn.\n"}]}