Skip to content

Commit

Permalink
docs: clarify git diff modes of operation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Nov 5, 2010
1 parent 9edb8a0 commit 49bd56a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 8 additions & 3 deletions Documentation/git-diff.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ git-diff - Show changes between commits, commit and working tree, etc

SYNOPSIS
--------
'git diff' [<common diff options>] [<commit> [<commit>]] [--] [<path>...]
[verse]
'git diff' [options] [<commit>] [--] [<path>...]
'git diff' [options] --cached [<commit>] [--] [<path>...]
'git diff' [options] <commit> <commit> [--] [<path>...]
'git diff' [options] [--no-index] [--] <path> <path>

DESCRIPTION
-----------
Show changes between two trees, a tree and the working tree, a
tree and the index file, or the index file and the working tree.
Show changes between the working tree and the index or a tree, changes
between the index and a tree, changes between two trees, or changes
between two files on disk.

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

Expand Down
3 changes: 2 additions & 1 deletion Documentation/git-difftool.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ DESCRIPTION
-----------
'git difftool' is a git command that allows you to compare and edit files
between revisions using common diff tools. 'git difftool' is a frontend
to 'git diff' and accepts the same options and arguments.
to 'git diff' and accepts the same options and arguments. See
linkgit:git-diff[1].

OPTIONS
-------
Expand Down

0 comments on commit 49bd56a

Please sign in to comment.