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

Re: doc: git-clone: Improve discoverability of --no-single-branch flag

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 30, 2025, 19:17 UTC
Message-ID
<xmqqcyct1mtq.fsf@gitster.g>
In-Reply-To
<057e8f72-ea67-432b-a687-2b5af08fba05@app.fastmail.com>
"Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com> writes:
Show 14 quoted lines
> Many options are documented as `--[no-]`.
>
>     git grep --fixed-string -- '--[no-]' Documentation/ ':(exclude)Documentation/RelNotes/'
>
> This is explained in gitcli(7), “Enhanced Option Parser” (for some
> commands), “Negating options”:
>
>        Options with long option names can be negated by prefixing
>        --no-. For example, git branch has the option --track which is on
>        by default. You can use --no-track to override that
>        behaviour. The same goes for --color and --no-color.
>
> A concern might be that changing `--single-branch` in this way would be
> inconsistent with the overall style.
A pair of quick counts:
    $ git grep -E -e '^`?--no-' Documentation/ | wc -l
    189
    $ git grep -E -e '^`?--\[no-\]' Documentation/ | wc -l
    80
I think we should try to unify to the following style:
    `--frotz=<string>`::
    `--no-frotz`::
	When `--frotz` is given, the command does THIS using the
        given argument <string> IN THIS WAY.  The default is not to
        to THIS, unless SUCH AND SUCH CONDITION, in which case THAT
        is used implicitly as <string>.  To disable THIS even when
        SUCH AND SUCH CONDITION is met, use `--no-frotz`.
That is:
 * Both positive and negative form are given separately as a
   headline item, so that "grep" would work well;
 * The description should be unified, so that it is clear to readers
   what happens when the positive form is given, when the negative
   form is given, and when neither is given.
 * Mark-up the text that the users MUST input literally inside a
   pair of backquotes.

Which means that existing "--[no-]opt::" heading should become two lines, "`--opt`::" and "`--no-opt`::".

Thanks.
Previous: Kristoffer HaugsbakkNext: D. Ben Knoble
Message 3 of 4 in “doc: git-clone: Improve discoverability of --no-single-branch flag”
  1. Lino HauptApr 30, 2025
  2. Kristoffer HaugsbakkApr 30, 2025
  3. Junio C HamanoApr 30, 2025
  4. D. Ben KnobleMay 1, 2025

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.