git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: jaydeepjd.8914@gmail.com
Cc: Bagas Sanjaya <bagasdotme@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] t/t0015-hash.sh: removed unnecessary '\' at line end
Date: Thu, 10 Feb 2022 09:20:02 -0800	[thread overview]
Message-ID: <xmqq1r0awse5.fsf@gitster.g> (raw)
In-Reply-To: <bc36eab7-62ae-2e67-aa4f-cceec5c86012@gmail.com> (jaydeepjd's message of "Thu, 10 Feb 2022 12:41:55 +0530")

jaydeepjd.8914@gmail.com writes:

> 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.


      reply	other threads:[~2022-02-10 17:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08  9:23 [PATCH] t/t0015-hash.sh: removed unnecessary '\' at line end Jaydeep P Das
2022-02-08  9:23 ` Jaydeep P Das
2022-02-10  1:18   ` Bagas Sanjaya
2022-02-10  1:42     ` Junio C Hamano
2022-02-10  5:52       ` jaydeepjd.8914
2022-02-10  6:47         ` Junio C Hamano
2022-02-10  7:11           ` jaydeepjd.8914
2022-02-10 17:20             ` Junio C Hamano [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqq1r0awse5.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=bagasdotme@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jaydeepjd.8914@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).