git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Legendre <legendre@anatoscope.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Exit status of git show-ref --verify
Date: Mon, 06 Jul 2020 18:55:35 +0000	[thread overview]
Message-ID: <ggXIwBvE8oQXAL_579a2DJEsrEdPmMHoqEfSmQ31AlmZYRQ7AABmC-pMv1st9ljCXzfw__hnFbNvcBzEWbEfyr7mDSaFYuLv2NM03EDTlhk=@anatoscope.com> (raw)

Hi,

I stumbled upon a small discrepancy between the documentation of git-show-ref
and its actual behavior. The documentation of the `--verify` flag of
git-show-ref says:

  "If nothing matches, 'git show-ref' will return an error code of 1"

Yet it seems to return 1 only if it is also called with --quiet. Tested with
the `next` branch:

  [~/dev/git] $ ./git show-ref --verify refs/heads/tagada
  fatal: 'refs/heads/tagada' - not a valid ref
  [~/dev/git] $ echo $?
  128

  [~/dev/git] $ ./git show-ref --quiet --verify refs/heads/tagada
  [~/dev/git] $ echo $?
  1


Regards,
Marc Legendre


                 reply	other threads:[~2020-07-06 18:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='ggXIwBvE8oQXAL_579a2DJEsrEdPmMHoqEfSmQ31AlmZYRQ7AABmC-pMv1st9ljCXzfw__hnFbNvcBzEWbEfyr7mDSaFYuLv2NM03EDTlhk=@anatoscope.com' \
    --to=legendre@anatoscope.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).