Re: [PATCH] remote: add meaningful exit code on missing/existing

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

 



Ævar Arnfjörð Bjarmason  <avarab@xxxxxxxxx> writes:

> Change the exit code for the likes of "git remote add/rename" to exit
> with 2 if the remote in question doesn't exist, and 3 if it
> does. Before we'd just die() and exit with the general 128 exit code.
>
> This changes the output message from e.g.:
>
>     fatal: remote origin already exists.
>
> To:
>
>     error: remote origin already exists.
>
> Which I believe is a feature, since we generally use "fatal" for the
> generic errors, and "error" for the more specific ones with a custom
> exit code, but this part of the change may break code that already
> relies on stderr parsing (not that we ever supported that...).

Sounds like a worthy goal.  One thing that disturbs me somewhat,
which the time will solve without any of our effort, is how the
calling scripts and machinery decides when they can start relying on
the exit codes.  A "git remote tell-me-what-you-can-do" command that
may or may not say "exitcode" to its standard output is added?
"test $(git version) -ge 2.30 || old_way"?

The changes to the code all looked quite straight-forward and 
the tests look sensible, too.

Thanks.




[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]

  Powered by Linux