git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG (maybe)] git rev-parse --verify --quiet isn't quiet

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 4, 2014, 17:57 UTC
Message-ID
<xmqq1trruv3b.fsf@gitster.dls.corp.google.com>
In-Reply-To
<loom.20140904T131954-274@post.gmane.org>
Øystein Walle <oystwa@gmail.com> writes:
Show 9 quoted lines
> 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?

Show 6 quoted lines
> 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.
Previous: Øystein WalleNext: Junio C Hamano
Message 2 of 4 in “[BUG (maybe)] git rev-parse --verify --quiet isn't quiet”
  1. Øystein WalleSep 4, 2014
  2. Junio C HamanoSep 4, 2014
  3. Junio C HamanoSep 4, 2014
  4. Øystein WalleSep 5, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.