git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "Štěpán Němec" <stepnem@gmail.com>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
	git@vger.kernel.org, Sverre Rabbelier <srabbelier@gmail.com>,
	Mark Lodato <lodatom@gmail.com>,
	Junio C Hamano <gitster@pobox.com>
Subject: [PATCH] docs: clarify git diff modes of operation
Date: Thu, 4 Nov 2010 17:17:29 -0400	[thread overview]
Message-ID: <20101104211729.GA5551@sigill.intra.peff.net> (raw)
In-Reply-To: <20101104204304.GA4641@sigill.intra.peff.net>

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>
---
On Thu, Nov 04, 2010 at 04:43:04PM -0400, Jeff King wrote:

> > So AIUI the patch can still be applied and we/you can then work on
> > improving the usage string in other ways -- providing that we agree that
> > the {M,N} notation should go, of course, which we apparently still
> > don't?
> 
> My main argument against that would be that if we are planning on
> changing it to something totally different right now anyway, your patch
> will just end up making textual conflicts for Junio to resolve. :)

I had intially thought I would tweak all three sites that you did, but
after thinking about it, I really just want to change the one in
Documentation/git-diff.txt. Which turned my patch into a mix of two
different changes, and means it probably should just go on top of yours.

So here is my patch, which should apply on top of yours.

Note that in all versions (the original, yours, and mine) we gloss over
the fact that <commit> can actually be any two objects (as long as they
are bother either tree-ishs or blobs). I'm not sure if it is worth
documenting that subtlety here (at least the tree-ish thing gets
mentioned later in the description; I'm not sure we ever document "git
diff HEAD:Makefile HEAD^:Makefile" anywhere).

Jonathan, does this look ok based on our earlier discussion?

 Documentation/git-diff.txt     |   11 ++++++++---
 Documentation/git-difftool.txt |    3 ++-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/Documentation/git-diff.txt b/Documentation/git-diff.txt
index 61728f6..f6ac847 100644
--- a/Documentation/git-diff.txt
+++ b/Documentation/git-diff.txt
@@ -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>...]::
 
diff --git a/Documentation/git-difftool.txt b/Documentation/git-difftool.txt
index a02e3b5..6fffbc7 100644
--- a/Documentation/git-difftool.txt
+++ b/Documentation/git-difftool.txt
@@ -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
 -------
-- 
1.7.3.2.218.g4ee9d

  reply	other threads:[~2010-11-04 21:16 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-08  0:52 [PATCH/RFC] Unify argument and option notation in the docs Štěpán Němec
2010-10-08  7:43 ` Jonathan Nieder
2010-10-08 11:13   ` Štěpán Němec
2010-10-08 17:31     ` [PATCH 0/6] " Štěpán Němec
2010-10-08 17:44       ` Jonathan Nieder
2010-10-08 19:43       ` Junio C Hamano
2010-10-08 20:15         ` Štěpán Němec
2010-10-21 22:21           ` Jonathan Nieder
2010-10-24 15:51             ` [PATCH] CodingGuidelines: Add a section on writing documentation Štěpán Němec
2010-10-29  2:56               ` Mark Lodato
2010-10-29 11:54                 ` Štěpán Němec
2010-10-29 17:14                   ` Sverre Rabbelier
2010-11-01 17:00                     ` Štěpán Němec
2010-11-04 17:12                       ` [PATCH v2] " Štěpán Němec
2010-11-04 17:18                       ` [PATCH] diff,difftool: Don't use the {0,2} notation in usage strings Štěpán Němec
2010-11-04 17:22                         ` Sverre Rabbelier
2010-11-04 17:49                         ` Jeff King
2010-11-04 18:02                           ` Jonathan Nieder
2010-11-04 18:13                             ` Jeff King
2010-11-04 18:38                               ` Jonathan Nieder
2010-11-04 18:55                                 ` Jeff King
2010-11-04 20:26                                   ` Štěpán Němec
2010-11-04 20:43                                     ` Jeff King
2010-11-04 21:17                                       ` Jeff King [this message]
2010-11-04 21:50                                         ` [PATCH] docs: clarify git diff modes of operation Jonathan Nieder
2010-11-05  1:57                                           ` Mark Lodato
2010-11-04 21:51                                         ` Štěpán Němec
2010-11-04 21:30                                       ` [PATCH] diff,difftool: Don't use the {0,2} notation in usage strings Štěpán Němec
2010-10-08 17:31     ` [PATCH 1/6] Use angles for placeholders consistently Štěpán Němec
2010-10-08 17:31     ` [PATCH 2/6] Fix odd markup in --diff-filter documentation Štěpán Němec
2010-10-08 17:39       ` Jonathan Nieder
2010-10-08 17:57         ` Štěpán Němec
2010-10-08 18:03           ` Jonathan Nieder
2010-10-08 18:40             ` Štěpán Němec
2010-10-08 18:53               ` Jonathan Nieder
2010-10-08 17:31     ` [PATCH 3/6] Use parentheses and `...' where appropriate Štěpán Němec
2010-10-08 17:31     ` [PATCH 4/6] Remove stray quotes in --pretty and --format documentation Štěpán Němec
2010-10-08 17:31     ` [PATCH 5/6] Put a space between `<' and argument in pack-objects usage string Štěpán Němec
2010-10-08 17:31     ` [PATCH 6/6] Fix {update,checkout}-index usage strings Štěpán Němec
2010-10-08 16:45   ` [PATCH 0/2] pack-objects: use ALLOC_GROW in place of manual growth Jonathan Nieder
2010-10-08 16:46     ` [PATCH 1/2] Documentation: No argument of ALLOC_GROW should have side-effects Jonathan Nieder
2010-10-08 16:47     ` [PATCH 2/2] pack-objects: use ALLOC_GROW Jonathan Nieder
2010-10-08 17:02     ` [PATCH 3/2] Allow side-effects in second argument to ALLOC_GROW Jonathan Nieder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101104211729.GA5551@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=lodatom@gmail.com \
    --cc=srabbelier@gmail.com \
    --cc=stepnem@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).