From: Sean Allred <allred.sean@gmail.com>
To: git <git@vger.kernel.org>
Subject: What are cherry-pick's exit codes?
Date: Thu, 01 Dec 2022 00:39:35 -0600 [thread overview]
Message-ID: <878rjry5a7.fsf@gmail.com> (raw)
Hi folks,
We're developing some internal tooling wrapping git-cherry-pick and need
to be able to distinguish its different error codes. Problem is: these
exit codes don't seem to be documented in git-cherry-pick.txt.
Looking at the source, I found myself down the rabbit-hole very quickly.
I'm not too familiar with the coding patterns quite yet -- but I'm
pretty sure I eventually found myself redirected to git-commit in one
case. At that point, I thought it better to ask here.
I'd like to document these exit codes in the manpage and I'm more than
happy to submit the patch, but I thought I'd confirm my understanding
first since it's based purely on reading the cherry-pick tests:
Exit code:
- 0: success, sequencer complete -- no conflicts
- 1: 'success', sequencer incomplete -- conflicts encountered
- 127: fatal -- lots of reasons -- I'm guessing this is value for the
'return -1' and 'return error(...)' statements speckled throughout
the code, but it's been a long time since I cared about two's
complement so I may be wrong here.
- 128: fatal -- sequence is interrupted, possibly due to some other
fatal error, e.g., 'commit doesn't exist' or 'mainline parent number
doesn't exist'
- 129: fatal -- there was nothing to cherry-pick at all (e.g. empty
range)
I'm reasonably confident about 0/1 just anecdotally -- I'm less sure
about everything else.
Obviously the actual text put in the manpage should be friendlier and
possibly vaguer for clarity (paradoxical, perhaps, but it seems more
direct to say '0 for success, 1 for conflicts, and anything else is a
fatal error'), but I wanted to make sure that I have an actually-
accurate understanding rather than something only surface-level.
Two questions:
1. Are the exit codes actually documented somewhere already that
should simply be linked from git-cherry-pick.txt?
2. If not, is the above listing the exit codes accurate and complete?
Thanks!
--
Sean Allred
next reply other threads:[~2022-12-01 7:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-01 6:39 Sean Allred [this message]
2022-12-01 12:19 ` What are cherry-pick's exit codes? Ævar Arnfjörð Bjarmason
2022-12-01 13:38 ` Sean Allred
2022-12-01 14:43 ` Phillip Wood
2022-12-01 14:45 ` Sean Allred
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878rjry5a7.fsf@gmail.com \
--to=allred.sean@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).