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

Re: [PATCH 1/5] doc: git-add: remove options from SYNOPSIS

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 12, 2025, 20:41 UTC
Message-ID
<xmqqms84s276.fsf@gitster.g>
In-Reply-To
<3a2cc38b72fb0f6ccc0ec9cbefadb7576cd8b934.1755029249.git.gitgitgadget@gmail.com>
"Julia Evans via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 7 quoted lines
> 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?")

Show 5 quoted lines
> `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.

Show 6 quoted lines
>  [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
>  -----------
Previous: Julia Evans via GitGitGadgetNext: Julia Evans
Message 3 of 59 in “doc: git-add: clarify DESCRIPTION section”
  1. 0/5 doc: git-add: clarify DESCRIPTION sectionJulia Evans via GitGitGadget, Aug 12, 2025
  2. 1/5 doc: git-add: remove options from SYNOPSISJulia Evans via GitGitGadget, Aug 12, 2025
  3. Junio C HamanoAug 12, 2025
  4. Julia EvansAug 13, 2025
  5. Jean-Noël AVILAAug 13, 2025
  6. 2/5 doc: git-add: start man page with an exampleJulia Evans via GitGitGadget, Aug 12, 2025
  7. Junio C HamanoAug 12, 2025
  8. Julia EvansAug 12, 2025
  9. Junio C HamanoAug 12, 2025
  10. Julia EvansAug 12, 2025
  11. D. Ben KnobleAug 13, 2025
  12. Junio C HamanoAug 14, 2025
  13. Julia EvansAug 14, 2025
  14. Junio C HamanoAug 15, 2025
  15. 3/5 doc: git-add: simplify discussion of ignored filesJulia Evans via GitGitGadget, Aug 12, 2025
  16. D. Ben KnobleAug 13, 2025
  17. 4/5 doc: git-add: make explanation less dryJulia Evans via GitGitGadget, Aug 12, 2025
  18. 5/5 doc: git-add: explain inconsistent terminologyJulia Evans via GitGitGadget, Aug 12, 2025
  19. Chris TorekAug 12, 2025
  20. Junio C HamanoAug 12, 2025
  21. Julia EvansAug 12, 2025
  22. 0/4 doc: git-add: clarify DESCRIPTION sectionJulia Evans via GitGitGadget, Aug 13, 2025
  23. 1/4 doc: git-add: start man page with an exampleJulia Evans via GitGitGadget, Aug 13, 2025
  24. Junio C HamanoAug 15, 2025
  25. Jean-Noël AVILAAug 15, 2025
  26. Junio C HamanoAug 15, 2025
  27. Jean-Noël AVILAAug 17, 2025
  28. Julia EvansAug 19, 2025
  29. 2/4 doc: git-add: simplify discussion of ignored filesJulia Evans via GitGitGadget, Aug 13, 2025
  30. D. Ben KnobleAug 14, 2025
  31. Junio C HamanoAug 14, 2025
  32. 3/4 doc: git-add: make explanation less dryJulia Evans via GitGitGadget, Aug 13, 2025
  33. Junio C HamanoAug 14, 2025
  34. Julia EvansAug 15, 2025
  35. D. Ben KnobleAug 15, 2025
  36. Junio C HamanoAug 15, 2025
  37. D. Ben KnobleAug 16, 2025
  38. Junio C HamanoAug 15, 2025
  39. Julia EvansAug 19, 2025
  40. Jean-Noël AVILAAug 21, 2025
  41. 4/4 doc: git-add: explain inconsistent terminologyJulia Evans via GitGitGadget, Aug 13, 2025
  42. Junio C HamanoAug 14, 2025
  43. Julia EvansAug 19, 2025
  44. 0/3 doc: git-add: clarify DESCRIPTION sectionJulia Evans via GitGitGadget, Aug 19, 2025
  45. 1/3 Git 2.51Junio C Hamano via GitGitGadget, Aug 19, 2025
  46. rsbecker@nexbridge.comAug 19, 2025
  47. Junio C HamanoAug 19, 2025
  48. D. Ben KnobleAug 19, 2025
  49. Julia EvansAug 19, 2025
  50. rsbecker@nexbridge.comAug 19, 2025
  51. 3/3 doc: git-add: simplify discussion of ignored filesJulia Evans via GitGitGadget, Aug 19, 2025
  52. Junio C HamanoAug 21, 2025
  53. 2/3 doc: git-add: clarify intro & add an exampleJulia Evans via GitGitGadget, Aug 19, 2025
  54. Junio C HamanoAug 21, 2025
  55. Julia EvansAug 22, 2025
  56. 0/2 doc: git-add: clarify DESCRIPTION sectionJulia Evans via GitGitGadget, Aug 29, 2025
  57. 1/2 doc: git-add: clarify intro & add an exampleJulia Evans via GitGitGadget, Aug 29, 2025
  58. 2/2 doc: git-add: simplify discussion of ignored filesJulia Evans via GitGitGadget, Aug 29, 2025
  59. Junio C HamanoAug 29, 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.