public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: "Øystein Walle" <oystwa@gmail•com>
Cc: git@vger•kernel.org
Subject: Re: [BUG (maybe)] git rev-parse --verify --quiet isn't quiet
Date: Thu, 04 Sep 2014 10:57:44 -0700	[thread overview]
Message-ID: <xmqq1trruv3b.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <loom.20140904T131954-274@post.gmane.org> ("Øystein Walle"'s message of "Thu, 4 Sep 2014 11:20:45 +0000 (UTC)")

Øystein Walle <oystwa@gmail•com> writes:

> I noticed this while writing a small script for myself:
>
>     $ git rev-parse --verify --quiet '@{u}'
>     fatal: No upstream configured for branch 'local'
>
> The functions that get run when rev-parse does its thing all return a
> pointer to a strbuf, return the length of the modified buf or something
> to that effect. However get_upstream_branch() calls die() which writes
> to stderr unconditionally.

I would suspect that this may be fine.

"rev-parse --verify" makes sure the named object exists, but in this
case @{u} does not even name any object, does it?

> On a related note:
>
>     $ git branch origin/master
>     $ git rev-parse --verify --quiet origin/master
>     warning: refname 'origin/master' is ambiguous.
>     7c07808349fd0fc2c61a169833eeb55163cf3df4   

And this warning is in the same vein, I would suspect.

  reply	other threads:[~2014-09-04 17:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-04 11:20 [BUG (maybe)] git rev-parse --verify --quiet isn't quiet Øystein Walle
2014-09-04 17:57 ` Junio C Hamano [this message]
2014-09-04 18:12   ` Junio C Hamano
2014-09-05  7:15     ` Øystein Walle

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=xmqq1trruv3b.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=oystwa@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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