]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/diff: update usage comment
authorDenton Liu <liu.denton@gmail.com>
Thu, 18 Jun 2020 10:43:34 +0000 (06:43 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 18 Jun 2020 22:01:15 +0000 (15:01 -0700)
commita9d7689cd405883849fc5bc5427812654d59394f
tree5094ba6a02dbd00e68f0263753070b04243ad884
parentaf6b65d45ef179ed52087e80cb089f6b2349f4ec
builtin/diff: update usage comment

A comment in cmd_diff() states that if one tree-ish and no blobs are
provided, (the "N=1, M=0" case), it will provide a diff between the tree
and the cache. This is incorrect because a diff happens between the
tree-ish and the working tree. Remove the `--cached` in the comment so
that the correct behavior is shown. Add a new section describing the
"N=1, M=0, --cached" behavior.

Next, describe the "N=0, M=0, --cached" case, similar to the above since
it is undocumented.

Finally, fix some spacing issues. Add spaces between each section for
consistency and readability. Also, change tabs within the comment into
spaces.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/diff.c