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

Re: [PATCH] t/t0015-hash.sh: removed unnecessary '\' at line end

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 10, 2022, 17:20 UTC
Message-ID
<xmqq1r0awse5.fsf@gitster.g>
In-Reply-To
<bc36eab7-62ae-2e67-aa4f-cceec5c86012@gmail.com>
jaydeepjd.8914@gmail.com writes:
Show 20 quoted lines
> Here is an example. The synopsis of command `send-email` vs synopsis of `commit`:
>
> ```
> git send-email [<options>] <file|directory>…​
> git send-email [<options>] <format-patch options>
> git send-email --dump-aliases
> ```
>
> ```
> git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]
> 	   [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|reword):]<commit>)]
> 	   [-F <file> | -m <msg>] [--reset-author] [--allow-empty]
> 	   [--allow-empty-message] [--no-verify] [-e] [--author=<author>]
> 	   [--date=<date>] [--cleanup=<mode>] [--[no-]status]
> 	   [-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]
> 	   [(--trailer <token>[(=|:)<value>])…​] [-S[<keyid>]]
> 	   [--] [<pathspec>…​]
> ```
>
> The `commit` synopsis has a more verbose overview of all the options available compared to `send-email` synopsis.

I think the former is more modern style that leaves the description of options to the main text. It also allows the synopsis section to make it stand out very different operating modes instead of having the alternative listed with [ A | B | C ] and having the readers guess if all combinations of alternatives are valid (they are often not).

The former style takes more thought to write well, when a command is multi-purpose and has different operating modes (cf. "git checkout").

For "git commit", even though conceptually creating a totally new commit and amending the current one are two quite distinct opeating modes, they pretty much take the same set of options, so I suspect we can do with just one

	git commit [<options>] [--] [<pathspec>...]

in the modern style, but I dunno (that is why I said "it takes more thought" and I cannot afford much time to think it through just for illustration purposes).

Thanks.
Previous: jaydeepjd.8914@gmail.com
Message 8 of 8 in “t/t0015-hash.sh: removed unnecessary '\' at line end”
  1. t/t0015-hash.sh: removed unnecessary '\' at line endJaydeep P Das, Feb 8, 2022
  2. t/t0015-hash.sh: removed unnecessary '\' at line endJaydeep P Das, Feb 8, 2022
  3. Bagas SanjayaFeb 10, 2022
  4. Junio C HamanoFeb 10, 2022
  5. jaydeepjd.8914@gmail.comFeb 10, 2022
  6. Junio C HamanoFeb 10, 2022
  7. jaydeepjd.8914@gmail.comFeb 10, 2022
  8. Junio C HamanoFeb 10, 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.