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

Re: [PATCH] Add cross-references between docs for for-each-ref and show-ref

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 22, 2014, 15:58 UTC
Message-ID
<xmqqbnz4ypmx.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1390389800-26769-1-git-send-email-mhagger@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
Show 7 quoted lines
> Add cross-references between the manpages for git-for-each-ref(1) and
> git-show-ref(1).
>
> Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
> ---
> There is a lot of overlap between the functionality of these two
> commands.
Two differences I most often use (i.e. take advantage of) are:
 - The former is about showing 0 or more matching refs, and not
   matching anything is a perfectly normal condition, i.e.
   $ git for-each-ref refs/heads/no-such
   exits with status 0.  The latter can be used with --verify to
   check if one ref exists, on the other hand.
 - The former takes the match-from-left-to-right pattern (similar to
   the usual pathspec match), while the latter matches from the
   tail.
   $ git for-each-ref refs/heads/*  ;# only one-level names
   $ git for-each-ref refs/heads/** ;# catches both master and mh/path-max
   $ git show-ref master ;# refs/heads/master, refs/remotes/origin/master,...
Previous: Michael Haggerty
Message 2 of 2 in “Add cross-references between docs for for-each-ref and show-ref”
  1. Add cross-references between docs for for-each-ref and show-refMichael Haggerty, Jan 22, 2014
  2. Junio C HamanoJan 22, 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.