Skip to content

Commit 49bd56a

Browse files
peffgitster
authored andcommitted
docs: clarify git diff modes of operation
It is an oversimplification to say that we can take "[<commit> [<commit>]]", as it really depends on what options have been given. Instead, let's list the major modes of operation separately, as we do in other manpages. This patch also adjusts the text immediately after the synopsis to match the lines given in the synopsis. For git-difftool, which has the same issue, let's refer the user to the git-diff manpage rather than spelling it all out again. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 9edb8a0 commit 49bd56a

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Documentation/git-diff.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@ git-diff - Show changes between commits, commit and working tree, etc
88

99
SYNOPSIS
1010
--------
11-
'git diff' [<common diff options>] [<commit> [<commit>]] [--] [<path>...]
11+
[verse]
12+
'git diff' [options] [<commit>] [--] [<path>...]
13+
'git diff' [options] --cached [<commit>] [--] [<path>...]
14+
'git diff' [options] <commit> <commit> [--] [<path>...]
15+
'git diff' [options] [--no-index] [--] <path> <path>
1216

1317
DESCRIPTION
1418
-----------
15-
Show changes between two trees, a tree and the working tree, a
16-
tree and the index file, or the index file and the working tree.
19+
Show changes between the working tree and the index or a tree, changes
20+
between the index and a tree, changes between two trees, or changes
21+
between two files on disk.
1722

1823
'git diff' [--options] [--] [<path>...]::
1924

Documentation/git-difftool.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ DESCRIPTION
1313
-----------
1414
'git difftool' is a git command that allows you to compare and edit files
1515
between revisions using common diff tools. 'git difftool' is a frontend
16-
to 'git diff' and accepts the same options and arguments.
16+
to 'git diff' and accepts the same options and arguments. See
17+
linkgit:git-diff[1].
1718

1819
OPTIONS
1920
-------

0 commit comments

Comments
 (0)