summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Chris Torek <chris.torek@gmail.com>2020-06-12 16:20:00 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-06-12 10:53:44 -0700
commitb7e10b2ca210d6a3647910fdecea33581e4eaf0d (patch)
tree9aa91d4091a4a239cb0dfbf67294a8f6a1eee993 /builtin
parentgit diff: improve range handling (diff)
downloadtgif-b7e10b2ca210d6a3647910fdecea33581e4eaf0d.tar.xz
Documentation: usage for diff combined commits
Document the usage for producing combined commits with "git diff". This includes updating the synopsis section. While here, add the three-dot notation to the synopsis. Make "git diff -h" print the same usage summary as the manual page synopsis, minus the "A..B" form, which is now discouraged. Signed-off-by: Chris Torek <chris.torek@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/diff.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin/diff.c b/builtin/diff.c
index 57bd6c8dfa..96ee2cbb2a 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -24,7 +24,13 @@
#define DIFF_NO_INDEX_IMPLICIT 2
static const char builtin_diff_usage[] =
-"git diff [<options>] [<commit> [<commit>]] [--] [<path>...]";
+"git diff [<options>] [<commit>] [--] [<path>...]\n"
+" or: git diff [<options>] --cached [<commit>] [--] [<path>...]\n"
+" or: git diff [<options>] <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"
+COMMON_DIFF_OPTIONS_HELP;
static const char *blob_path(struct object_array_entry *entry)
{