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

Re: [PATCH v2] symbolic-ref: teach "--[no-]recurse" option

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Oct 8, 2022, 04:54 UTC
Message-ID
<CAPig+cQHw_VjbA2_HaZJj3Q0v8C6uUukr40vXFuizx4M_04XFA@mail.gmail.com>
In-Reply-To
<xmqqsfjzaq78.fsf@gitster.g>
On Sat, Oct 8, 2022 at 12:34 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 20 quoted lines
> [...]
> One thing that is slightly irritating, however, is that I do not
> think there is a good way (other than "cat .git/HEAD") to learn that
> you checked out 'maint' to get into that state.  Just like the output
> of "git branch --show-current" shows above, "git symbolic-ref HEAD"
> would report 'refs/heads/maint-2.38', bypassing the intermediate
> symbolic ref at 'refs/heads/maint' that is pointed at by HEAD.
> [...]
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
> diff --git a/Documentation/git-symbolic-ref.txt b/Documentation/git-symbolic-ref.txt
> @@ -46,6 +46,15 @@ OPTIONS
> +--recurse::
> +--no-recurse::
> +       When showing the value of <name> as a symbolic ref, if
> +       <name> refers to another symbolic ref, follow such a chain
> +       of symbolic refs until the result no longer points at a
> +       symbolic ref (`--recurse`, which is the default).
> +       `--no-recurse` stops after dereferencing only a single level
> +       of symbolic ref.

With his recent documentation-normalization work, I suspect Ævar would appreciate an update to the synopsis, as well:

    SYNOPSIS
    --------
    [verse]
    'git symbolic-ref' [-m <reason>] <name> <ref>
   -'git symbolic-ref' [-q] [--short] <name>
   +'git symbolic-ref' [-q] [--short] [--no-recurse] <name>
    'git symbolic-ref' --delete [-q] <name>

or something similar (i.e. plain [--recurse] or composite [--[no-]-recurse] or [--recurse | --no-recurse]).

Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 13 in “symbolic-ref: teach "--[no-]recurse" option”
  1. symbolic-ref: teach "--[no-]recurse" optionJunio C Hamano, Oct 7, 2022
  2. Eric SunshineOct 8, 2022
  3. Junio C HamanoOct 8, 2022
  4. symbolic-ref: teach "--[no-]recurse" optionJunio C Hamano, Oct 8, 2022
  5. Eric SunshineOct 8, 2022
  6. Junio C HamanoOct 9, 2022
  7. Bagas SanjayaOct 8, 2022
  8. Junio C HamanoOct 9, 2022
  9. Philip OakleyOct 8, 2022
  10. Philip OakleyOct 8, 2022
  11. Junio C HamanoOct 9, 2022
  12. Philip OakleyOct 11, 2022
  13. symbolic-ref: teach "--[no-]recurse" optionJunio C Hamano, Oct 9, 2022

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.