From eb448631fb541239d91709d812b92bf2b57bc733 Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Sat, 10 Jul 2021 02:28:31 -0700 Subject: git-diff: fix missing --merge-base docs When `git diff --merge-base` was introduced at around Git 2.30, the documentation included a few errors. In the example given for `git diff --cached --merge-base`, the `--cached` flag was omitted for the `--merge-base` example. Add the missing flag. In the `git diff ` case, we failed to mention that `--merge-base` is an available option. Give the usage of `--merge-base` as an option there. Finally, there are two errors in the usage of `git diff`. Firstly, we do not mention `--merge-base` in the `git diff --cached` case. Mention it so that it's consistent with the documentation. Secondly, we put the `[--merge-base]` in between `` and `[...]`. Move the `[--merge-base]` so that it's beside `[]` which is a more logical grouping. Signed-off-by: Denton Liu Signed-off-by: Junio C Hamano --- builtin/diff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'builtin/diff.c') diff --git a/builtin/diff.c b/builtin/diff.c index b50fc68c2a..4c62876073 100644 --- a/builtin/diff.c +++ b/builtin/diff.c @@ -25,8 +25,8 @@ static const char builtin_diff_usage[] = "git diff [] [] [--] [...]\n" -" or: git diff [] --cached [] [--] [...]\n" -" or: git diff [] [--merge-base] [...] [--] [...]\n" +" or: git diff [] --cached [--merge-base] [] [--] [...]\n" +" or: git diff [] [--merge-base] [...] [--] [...]\n" " or: git diff [] ...] [--] [...]\n" " or: git diff [] ]\n" " or: git diff [] --no-index [--] ]\n" -- cgit v1.2.3