git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why usage function exit with code 129?
@ 2012-01-06  7:15 徐迪
  2012-01-06  7:22 ` Nguyen Thai Ngoc Duy
  0 siblings, 1 reply; 5+ messages in thread
From: 徐迪 @ 2012-01-06  7:15 UTC (permalink / raw)
  To: Git 邮件列表

I did like this:
$ git add --foo
$ echo $?
what I got is 129, should this code being used as program terminated
due to a signal? Cause it's 128+1. According to this[1].

[1] http://tldp.org/LDP/abs/html/exitcodes.html

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

* Re: Why usage function exit with code 129?
  2012-01-06  7:15 Why usage function exit with code 129? 徐迪
@ 2012-01-06  7:22 ` Nguyen Thai Ngoc Duy
  2012-01-06  8:06   ` 徐迪
  0 siblings, 1 reply; 5+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2012-01-06  7:22 UTC (permalink / raw)
  To: 徐迪; +Cc: Git 邮件列表

2012/1/6 徐迪 <xudifsd@gmail.com>:
> I did like this:
> $ git add --foo
> $ echo $?
> what I got is 129, should this code being used as program terminated
> due to a signal? Cause it's 128+1. According to this[1].

usage() (in your case) always returns 129, die() 128. See 5d1a5c0
([PATCH] Better error reporting for "git status")

> [1] http://tldp.org/LDP/abs/html/exitcodes.html

No it does not mean terminated by signals.
-- 
Duy

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

* Re: Why usage function exit with code 129?
  2012-01-06  7:22 ` Nguyen Thai Ngoc Duy
@ 2012-01-06  8:06   ` 徐迪
  2012-01-06  8:11     ` Nguyen Thai Ngoc Duy
  0 siblings, 1 reply; 5+ messages in thread
From: 徐迪 @ 2012-01-06  8:06 UTC (permalink / raw)
  To: Nguyen Thai Ngoc Duy; +Cc: Git 邮件列表

>> [1] http://tldp.org/LDP/abs/html/exitcodes.html
>
> No it does not mean terminated by signals.
> --
In that case, why not just use another code instead of the code that
leads misunderstanding? I mean, as far as I know, exit code between
129 and 255 are used to indicate the program terminated by signal. So
that usage function can only exit with code between 1 and 127. Am I
wrong?

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

* Re: Why usage function exit with code 129?
  2012-01-06  8:06   ` 徐迪
@ 2012-01-06  8:11     ` Nguyen Thai Ngoc Duy
  2012-01-06  8:18       ` 徐迪
  0 siblings, 1 reply; 5+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2012-01-06  8:11 UTC (permalink / raw)
  To: 徐迪; +Cc: Git 邮件列表

2012/1/6 徐迪 <xudifsd@gmail.com>:
>>> [1] http://tldp.org/LDP/abs/html/exitcodes.html
>>
>> No it does not mean terminated by signals.
>> --
> In that case, why not just use another code instead of the code that
> leads misunderstanding? I mean, as far as I know, exit code between
> 129 and 255 are used to indicate the program terminated by signal. So
> that usage function can only exit with code between 1 and 127. Am I
> wrong?

Because that code has been there too long (since 2005) any probably
all git commands, including plumbing ones, rely on it. Changing it now
may break existing scripts.
-- 
Duy

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

* Re: Why usage function exit with code 129?
  2012-01-06  8:11     ` Nguyen Thai Ngoc Duy
@ 2012-01-06  8:18       ` 徐迪
  0 siblings, 0 replies; 5+ messages in thread
From: 徐迪 @ 2012-01-06  8:18 UTC (permalink / raw)
  To: Nguyen Thai Ngoc Duy; +Cc: Git 邮件列表

在 2012年1月6日 下午4:11,Nguyen Thai Ngoc Duy <pclouds@gmail.com> 写道:
> 2012/1/6 徐迪 <xudifsd@gmail.com>:
>>>> [1] http://tldp.org/LDP/abs/html/exitcodes.html
>>>
>>> No it does not mean terminated by signals.
>>> --
>> In that case, why not just use another code instead of the code that
>> leads misunderstanding? I mean, as far as I know, exit code between
>> 129 and 255 are used to indicate the program terminated by signal. So
>> that usage function can only exit with code between 1 and 127. Am I
>> wrong?
>
> Because that code has been there too long (since 2005) any probably
> all git commands, including plumbing ones, rely on it. Changing it now
> may break existing scripts.
> --
> Duy

Ok, that sounds logical.

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

end of thread, other threads:[~2012-01-06  8:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-06  7:15 Why usage function exit with code 129? 徐迪
2012-01-06  7:22 ` Nguyen Thai Ngoc Duy
2012-01-06  8:06   ` 徐迪
2012-01-06  8:11     ` Nguyen Thai Ngoc Duy
2012-01-06  8:18       ` 徐迪

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