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

Re: [RFC/PATCH 3/2] rev-parse: --abbrev-ref option to shorten ref name

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 13, 2009, 16:43 UTC
Message-ID
<7vhc0sh5c1.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1239621626-26952-1-git-send-email-bert.wesarg@googlemail.com>
Bert Wesarg <bert.wesarg@googlemail.com> writes:
Show 13 quoted lines
> This applies the shorten_unambiguous_ref function to the object name.
> Default mode is controlled by core.warnAmbiguousRefs. Else it is given as
> optional argument to --abbrev-ref={strict|loose}.
>
> This should be faster than 'git for-each-ref --format="%(refname:short)" <ref>'
> for single refs.
>
> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
> ---
> Cc: Jeff King <peff@peff.net>
> Cc: git@vger.kernel.org
>
> Can someone check, if I need to alter the filter, thanks.
I do not think so.

This --abbrev-ref option is similar to --symbolic in that how a ref from the command line, if any, is output, and should not change the filter at all. For example, "rev-parse --abbrev-ref master -M" shouldn't filter -M out by implying --revs-only.

Previous: Bert Wesarg
Message 4 of 4 in “shorten_unambiguous_ref(): add strict mode”
  1. 1/2 shorten_unambiguous_ref(): add strict modeBert Wesarg, Apr 13, 2009
  2. 2/2 for-each-ref: utilize core.warnAmbiguousRefs for :short-formatBert Wesarg, Apr 13, 2009
  3. 3/2 rev-parse: --abbrev-ref option to shorten ref nameBert Wesarg, Apr 13, 2009
  4. Junio C HamanoApr 13, 2009

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.