git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Julia Evans via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,  Julia Evans <julia@jvns.ca>
Subject: Re: [PATCH 1/5] doc: git-add: remove options from SYNOPSIS
Date: Tue, 12 Aug 2025 13:41:01 -0700	[thread overview]
Message-ID: <xmqqms84s276.fsf@gitster.g> (raw)
In-Reply-To: <3a2cc38b72fb0f6ccc0ec9cbefadb7576cd8b934.1755029249.git.gitgitgadget@gmail.com> (Julia Evans via GitGitGadget's message of "Tue, 12 Aug 2025 20:07:25 +0000")

"Julia Evans via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Julia Evans <julia@jvns.ca>
>
> Motivations for this change:
>
> 1. Listing a huge number of options is visually overwhelming when
>    opening a man page for an unfamiliar command. It makes it harder
>    to understand the command's core syntax, like `git add <filename>`

For "git add", which has only one mode of operation, this may be
good.

Note that in general this is not necessarily a good idea, when a
command works in different modes (like "git branch" that can
list/enumerate or create/delete/manipulate), as not all the options
can be used in all the modes the command supports.  The "usage" part
of the output from "git branch -h" hits a good balance, and may want
to use as a model.

There is t0450 that aspires to ensure the short usage "git <cmd> -h"
matches the synopsis section of "git help <cmd>" for all <cmd>; right
now we have too many exceptions, and we should move towards making
these exceptions smaller.

> 2. For options which can be passed independently of any other options,
>    including them in the SYNOPSIS does not add any information which you
>    can't already get from reading the OPTIONS section.

Except that you have to scan a lot of text, which is quite
inefficient when you *know* the general idea behind the option you
want to use, and are only looking for the exact spelling of it (e.g.
"was it spelled --ignore-removed?")

> `git add` has
>    some mutually exclusive options, namely:
>    [--[no-]all | -A | --[no-]ignore-removal | [--update | -u]]
>    but personally I already find that line so hard to parse that
>    removing it doesn't remove a lot of information

It is a very good point why we may want to have these cues to
express "these go together" (my earlier example of "branch") and
"only one of these is used".  I tend to agree with you that these
are not necessarily very easy to read.

While it is important to make it easier for new readers to learn, we
should also keep in mind that nobody remains to be a newbie forever.

>  [synopsis]
> -git add [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [--patch | -p]
> -	[--edit | -e] [--[no-]all | -A | --[no-]ignore-removal | [--update | -u]] [--sparse]
> -	[--intent-to-add | -N] [--refresh] [--ignore-errors] [--ignore-missing] [--renormalize]
> -	[--chmod=(+|-)x] [--pathspec-from-file=<file> [--pathspec-file-nul]]
> -	[--] [<pathspec>...]

This being a long single line and with redundant "--long|-s" may be
making it unnecessarily ugly.  Have you considered folding lines and
simplifying "[--long | -s]" into "[-s]" and see if it makes easier
to follow?  Documentation/git-commit.adoc may serve as a better
model.

> +git add [<options>] [--] [<pathspec>...]
>  
>  DESCRIPTION
>  -----------

  reply	other threads:[~2025-08-12 20:41 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-12 20:07 [PATCH 0/5] doc: git-add: clarify DESCRIPTION section Julia Evans via GitGitGadget
2025-08-12 20:07 ` [PATCH 1/5] doc: git-add: remove options from SYNOPSIS Julia Evans via GitGitGadget
2025-08-12 20:41   ` Junio C Hamano [this message]
2025-08-13 16:58     ` Julia Evans
2025-08-13 20:47   ` Jean-Noël AVILA
2025-08-12 20:07 ` [PATCH 2/5] doc: git-add: start man page with an example Julia Evans via GitGitGadget
2025-08-12 21:01   ` Junio C Hamano
2025-08-12 21:40     ` Julia Evans
2025-08-12 22:12       ` Junio C Hamano
2025-08-12 22:45         ` Julia Evans
2025-08-13 17:22       ` D. Ben Knoble
2025-08-14  0:41       ` Junio C Hamano
2025-08-14  2:59         ` Julia Evans
2025-08-15  5:38           ` Junio C Hamano
2025-08-12 20:07 ` [PATCH 3/5] doc: git-add: simplify discussion of ignored files Julia Evans via GitGitGadget
2025-08-13 17:24   ` D. Ben Knoble
2025-08-12 20:07 ` [PATCH 4/5] doc: git-add: make explanation less dry Julia Evans via GitGitGadget
2025-08-12 20:07 ` [PATCH 5/5] doc: git-add: explain inconsistent terminology Julia Evans via GitGitGadget
2025-08-12 20:51   ` Chris Torek
2025-08-12 21:36     ` Junio C Hamano
2025-08-12 21:43       ` Julia Evans
2025-08-13 23:20 ` [PATCH v2 0/4] doc: git-add: clarify DESCRIPTION section Julia Evans via GitGitGadget
2025-08-13 23:20   ` [PATCH v2 1/4] doc: git-add: start man page with an example Julia Evans via GitGitGadget
2025-08-15  0:38     ` Junio C Hamano
2025-08-15 13:34       ` Jean-Noël AVILA
2025-08-15 16:33         ` Junio C Hamano
2025-08-17 18:37           ` Jean-Noël AVILA
2025-08-19 20:01             ` Julia Evans
2025-08-13 23:20   ` [PATCH v2 2/4] doc: git-add: simplify discussion of ignored files Julia Evans via GitGitGadget
2025-08-14  0:59     ` D. Ben Knoble
2025-08-14 22:10     ` Junio C Hamano
2025-08-13 23:20   ` [PATCH v2 3/4] doc: git-add: make explanation less dry Julia Evans via GitGitGadget
2025-08-14 22:22     ` Junio C Hamano
2025-08-15 16:10       ` Julia Evans
2025-08-15 18:25         ` D. Ben Knoble
2025-08-15 20:01           ` Junio C Hamano
2025-08-16 14:15             ` D. Ben Knoble
2025-08-15 19:47         ` Junio C Hamano
2025-08-19 12:57           ` Julia Evans
2025-08-21 20:36             ` Jean-Noël AVILA
2025-08-13 23:20   ` [PATCH v2 4/4] doc: git-add: explain inconsistent terminology Julia Evans via GitGitGadget
2025-08-14 22:49     ` Junio C Hamano
2025-08-19 20:09       ` Julia Evans
2025-08-19 20:46   ` [PATCH v3 0/3] doc: git-add: clarify DESCRIPTION section Julia Evans via GitGitGadget
2025-08-19 20:46     ` [PATCH v3 1/3] Git 2.51 Junio C Hamano via GitGitGadget
2025-08-19 21:06       ` rsbecker
2025-08-19 21:37         ` Junio C Hamano
2025-08-19 21:44           ` D. Ben Knoble
2025-08-19 21:48             ` Julia Evans
2025-08-19 21:49           ` rsbecker
2025-08-19 20:46     ` [PATCH v3 2/3] doc: git-add: clarify intro & add an example Julia Evans via GitGitGadget
2025-08-21 20:08       ` Junio C Hamano
2025-08-22 20:37         ` Julia Evans
2025-08-19 20:46     ` [PATCH v3 3/3] doc: git-add: simplify discussion of ignored files Julia Evans via GitGitGadget
2025-08-21 20:09       ` Junio C Hamano
2025-08-29 11:55     ` [PATCH v4 0/2] doc: git-add: clarify DESCRIPTION section Julia Evans via GitGitGadget
2025-08-29 11:55       ` [PATCH v4 1/2] doc: git-add: clarify intro & add an example Julia Evans via GitGitGadget
2025-08-29 11:55       ` [PATCH v4 2/2] doc: git-add: simplify discussion of ignored files Julia Evans via GitGitGadget
2025-08-29 17:11       ` [PATCH v4 0/2] doc: git-add: clarify DESCRIPTION section Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqms84s276.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=julia@jvns.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).