git-cli.txt: clarify "options first and then args"
commitc11f95010cc9f09ea3e5d401bc14c9b6663d2893
authorTeng Long <dyroneteng@gmail.com>
Mon, 17 Jan 2022 08:21:01 +0000 (17 16:21 +0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Jan 2022 19:42:25 +0000 (17 11:42 -0800)
tree851edb82f3594a1fb3a851bbd4a5d5edde13e3f3
parente9d7761bb94f20acc98824275e317fa82436c25d
git-cli.txt: clarify "options first and then args"

There are some commands permit the user whether to provide options
first before args, or the reverse order. For example:

    git push --dry-run <remote> <ref>

And:

    git push <remote> <ref> --dry-run

Both of them is supported, but some commands do not, for instance:

     git ls-remote --heads <remote>

And:

     git ls-remote <remote> --heads

If <remote> only has one ref and it's name is "refs/heads/--heads", you
will get the same result, otherwise will not.This is because the former
in the second example will parse "--heads" as an "option" which means
to limit to only "refs/heads" when listing the remote references, the
latter treat "--heads" as an argument which means to filter the result
list with the given pattern.

Therefore, we want to specify a bit more in "gitcli.txt" about the way
we recommend and help to resolve the ambiguity around some git command
usage. The related disscussions locate at [1].

By the way, there are some issues with lowercase letters in the document,
which have been modified together.

[1] https://public-inbox.org/git/cover.1642129840.git.dyroneteng@gmail.com/

Signed-off-by: Teng Long <dyroneteng@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/gitcli.txt