Re: [RFC PATCH 1/2] sh-setup: Make die take the error code as param.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fredrik Gustafsson <iveqy@xxxxxxxxx> writes:

> die used to print all parameters and then exit with code 1. Now die
> prints the first parameter and uses the optional second parameter as the
> exit code. The default exit code is 1.
>
> This allows scripts to control the exit code when they call die.
>
> All current git-code only uses the first parameter of die today so this
> change has no impact on them.

There are two issues in that logic.

The git-sh-setup API is a published interface that third-party Porcelains
can use, so it is insufficient to audit only the in-tree code.

Besides, your audit of in-tree code is insufficient. See output from this:

    $ git grep -A1 -n -e 'die .*\\$' -- '*.sh'

The hits in git-bisect.sh and git-rebase--merge.sh both pass two strings.

Can't you instead introduce a new "die_with_status" function and use it?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]