{"thread":{"id":"29302","subject":"Why usage function exit with code 129?","startedAt":"2012-01-06T07:15:07Z","lastAt":"2012-01-06T08:18:23Z","messageCount":5,"participants":["徐迪","Nguyen Thai Ngoc Duy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"182008","messageId":"CAMocUqSbiO2XC3PUEciyV3HxgqDPW_rTW-hYH4P=C=BFCSrQMQ@mail.gmail.com","threadId":"29302","inReplyTo":null,"subject":"Why usage function exit with code 129?","fromName":"徐迪","fromEmail":"xudifsd@gmail.com","sentAt":"2012-01-06T07:15:07Z","receivedAt":"2012-01-06T07:15:07Z","isPatch":false,"sender":{"key":"xudifsd@gmail.com","avatar":"https://gravatar.com/avatar/260814589d486b8dba6ff105f193d831bf9de466d688a20c53f7a516c7ffe146?d=mp&s=160"},"body":"I did like this:\n$ git add --foo\n$ echo $?\nwhat I got is 129, should this code being used as program terminated\ndue to a signal? Cause it's 128+1. According to this[1].\n\n[1] http://tldp.org/LDP/abs/html/exitcodes.html\n"},{"id":"182009","messageId":"CACsJy8Amo_9-9oCgHbwOZvTaNOV3Jj6wLCTU7nZT5LeA55=NEA@mail.gmail.com","threadId":"29302","inReplyTo":"CAMocUqSbiO2XC3PUEciyV3HxgqDPW_rTW-hYH4P=C=BFCSrQMQ@mail.gmail.com","subject":"Re: Why usage function exit with code 129?","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-01-06T07:22:56Z","receivedAt":"2012-01-06T07:22:56Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"2012/1/6 徐迪 <xudifsd@gmail.com>:\n> I did like this:\n> $ git add --foo\n> $ echo $?\n> what I got is 129, should this code being used as program terminated\n> due to a signal? Cause it's 128+1. According to this[1].\n\nusage() (in your case) always returns 129, die() 128. See 5d1a5c0\n([PATCH] Better error reporting for \"git status\")\n\n> [1] http://tldp.org/LDP/abs/html/exitcodes.html\n\nNo it does not mean terminated by signals.\n-- \nDuy\n"},{"id":"182012","messageId":"CAMocUqSmes+x_tkP6V0OM5rQ5wDGmMm=Q2MFBPhz6Qvzz_SOTg@mail.gmail.com","threadId":"29302","inReplyTo":"CACsJy8Amo_9-9oCgHbwOZvTaNOV3Jj6wLCTU7nZT5LeA55=NEA@mail.gmail.com","subject":"Re: Why usage function exit with code 129?","fromName":"徐迪","fromEmail":"xudifsd@gmail.com","sentAt":"2012-01-06T08:06:09Z","receivedAt":"2012-01-06T08:06:09Z","isPatch":false,"sender":{"key":"xudifsd@gmail.com","avatar":"https://gravatar.com/avatar/260814589d486b8dba6ff105f193d831bf9de466d688a20c53f7a516c7ffe146?d=mp&s=160"},"body":">> [1] http://tldp.org/LDP/abs/html/exitcodes.html\n>\n> No it does not mean terminated by signals.\n> --\nIn that case, why not just use another code instead of the code that\nleads misunderstanding? I mean, as far as I know, exit code between\n129 and 255 are used to indicate the program terminated by signal. So\nthat usage function can only exit with code between 1 and 127. Am I\nwrong?\n"},{"id":"182013","messageId":"CACsJy8D8uKGhtg4zjbHsJCGmqjTwodzFmAZ5w=aUx9CdadVAfw@mail.gmail.com","threadId":"29302","inReplyTo":"CAMocUqSmes+x_tkP6V0OM5rQ5wDGmMm=Q2MFBPhz6Qvzz_SOTg@mail.gmail.com","subject":"Re: Why usage function exit with code 129?","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-01-06T08:11:36Z","receivedAt":"2012-01-06T08:11:36Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"2012/1/6 徐迪 <xudifsd@gmail.com>:\n>>> [1] http://tldp.org/LDP/abs/html/exitcodes.html\n>>\n>> No it does not mean terminated by signals.\n>> --\n> In that case, why not just use another code instead of the code that\n> leads misunderstanding? I mean, as far as I know, exit code between\n> 129 and 255 are used to indicate the program terminated by signal. So\n> that usage function can only exit with code between 1 and 127. Am I\n> wrong?\n\nBecause that code has been there too long (since 2005) any probably\nall git commands, including plumbing ones, rely on it. Changing it now\nmay break existing scripts.\n-- \nDuy\n"},{"id":"182015","messageId":"CAMocUqR5NtLJTzEDXN6Os=b0w1aP6BMb6uphNJgZWKFT0dJy-Q@mail.gmail.com","threadId":"29302","inReplyTo":"CACsJy8D8uKGhtg4zjbHsJCGmqjTwodzFmAZ5w=aUx9CdadVAfw@mail.gmail.com","subject":"Re: Why usage function exit with code 129?","fromName":"徐迪","fromEmail":"xudifsd@gmail.com","sentAt":"2012-01-06T08:18:23Z","receivedAt":"2012-01-06T08:18:23Z","isPatch":false,"sender":{"key":"xudifsd@gmail.com","avatar":"https://gravatar.com/avatar/260814589d486b8dba6ff105f193d831bf9de466d688a20c53f7a516c7ffe146?d=mp&s=160"},"body":"在 2012年1月6日 下午4:11，Nguyen Thai Ngoc Duy <pclouds@gmail.com> 写道：\n> 2012/1/6 徐迪 <xudifsd@gmail.com>:\n>>>> [1] http://tldp.org/LDP/abs/html/exitcodes.html\n>>>\n>>> No it does not mean terminated by signals.\n>>> --\n>> In that case, why not just use another code instead of the code that\n>> leads misunderstanding? I mean, as far as I know, exit code between\n>> 129 and 255 are used to indicate the program terminated by signal. So\n>> that usage function can only exit with code between 1 and 127. Am I\n>> wrong?\n>\n> Because that code has been there too long (since 2005) any probably\n> all git commands, including plumbing ones, rely on it. Changing it now\n> may break existing scripts.\n> --\n> Duy\n\nOk, that sounds logical.\n"}]}