summaryrefslogtreecommitdiff
path: root/builtin/diff.c
diff options
context:
space:
mode:
authorDenton Liu <liu.denton@gmail.com>2021-07-10 02:28:31 -0700
committerJunio C Hamano <gitster@pobox.com>2021-07-12 13:55:29 -0700
commiteb448631fb541239d91709d812b92bf2b57bc733 (patch)
tree85ba0ef1bf1d011fb361ad755fd642c87ecf2e0e /builtin/diff.c
parentcce7d6ecfc45f0d74a95c6ca6447d6e327791348 (diff)
downloadgit-eb448631fb541239d91709d812b92bf2b57bc733.tar.gz
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 <commit>` 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 `<commit>` and `[<commit>...]`. Move the `[--merge-base]` so that it's beside `[<options>]` which is a more logical grouping. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/diff.c')
-rw-r--r--builtin/diff.c4
1 files changed, 2 insertions, 2 deletions
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 [<options>] [<commit>] [--] [<path>...]\n"
-" or: git diff [<options>] --cached [<commit>] [--] [<path>...]\n"
-" or: git diff [<options>] <commit> [--merge-base] [<commit>...] <commit> [--] [<path>...]\n"
+" or: git diff [<options>] --cached [--merge-base] [<commit>] [--] [<path>...]\n"
+" or: git diff [<options>] [--merge-base] <commit> [<commit>...] <commit> [--] [<path>...]\n"
" or: git diff [<options>] <commit>...<commit>] [--] [<path>...]\n"
" or: git diff [<options>] <blob> <blob>]\n"
" or: git diff [<options>] --no-index [--] <path> <path>]\n"