git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH/RFC 12/12] diff docs: remove <rev>{0,2} notation

From
Mark Lodato <lodatom@gmail.com>
Date
Mar 13, 2010, 04:53 UTC
Message-ID
<1268455984-19061-13-git-send-email-lodatom@gmail.com>
In-Reply-To
<1268455984-19061-1-git-send-email-lodatom@gmail.com>

This notation is not used anywhere else, so it can be confusing when first encountered. Instead, prefer the slightly longer but just as clear "[<rev> [<rev>]]", which is consistent with other commands.

Signed-off-by: Mark Lodato <lodatom@gmail.com>
---
When I first ran `git diff -h` and I saw the old syntax, I was rather
confused.  It took me a minute to realize that this was the regular
expression syntax.  I think it's best to stick with one syntax, even if
it is a bit more verbose.
 Documentation/git-diff.txt     |    2 +-
 Documentation/git-difftool.txt |    2 +-
 builtin/diff.c                 |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-diff.txt b/Documentation/git-diff.txt
index 4582179..e2d868d 100644
--- a/Documentation/git-diff.txt
+++ b/Documentation/git-diff.txt
@@ -8,7 +8,7 @@ git-diff - Show changes between commits, commit and working tree, etc
 
 SYNOPSIS
 --------
-'git diff' [<common diff options>] <commit>{0,2} [--] [<path>...]
+'git diff' [<common diff options>] [<commit> [<commit>]] [--] [<path>...]
 
 DESCRIPTION
 -----------
diff --git a/Documentation/git-difftool.txt b/Documentation/git-difftool.txt
index 8250bad..a02e3b5 100644
--- a/Documentation/git-difftool.txt
+++ b/Documentation/git-difftool.txt
@@ -7,7 +7,7 @@ git-difftool - Show changes using common diff tools
 
 SYNOPSIS
 --------
-'git difftool' [<options>] <commit>{0,2} [--] [<path>...]
+'git difftool' [<options>] [<commit> [<commit>]] [--] [<path>...]
 
 DESCRIPTION
 -----------
diff --git a/builtin/diff.c b/builtin/diff.c
index f73da93..e2e2efc 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -21,7 +21,7 @@ struct blobinfo {
 };
 
 static const char builtin_diff_usage[] =
-"git diff [<options>] <rev>{0,2} [--] [<path>...]";
+"git diff [<options>] [<rev> [<rev>]] [--] [<path>...]";
 
 static void stuff_change(struct diff_options *opt,
 			 unsigned old_mode, unsigned new_mode,
-- 
1.7.0.2
Previous: Mark Lodato
Message 20 of 20 in “docs: use metavariables consistently”
  1. 00/12 docs: use metavariables consistentlyMark Lodato, Mar 13, 2010
  2. 01/12 commit-tree: allow indirect tree referencesMark Lodato, Mar 13, 2010
  3. Junio C HamanoMar 13, 2010
  4. Mark LodatoMar 16, 2010
  5. 02/12 grep docs: grep accepts a <tree-ish>, not a <tree>Mark Lodato, Mar 13, 2010
  6. Junio C HamanoMar 13, 2010
  7. Mark LodatoMar 16, 2010
  8. 03/12 fsck docs: remove outdated and useless diagnosticMark Lodato, Mar 13, 2010
  9. 04/12 docs: use <sha1> to mean unabbreviated IDMark Lodato, Mar 13, 2010
  10. 05/12 docs: differentiate between <tag> and <tagname>Mark Lodato, Mar 13, 2010
  11. Junio C HamanoMar 13, 2010
  12. 06/12 docs: clarify <object>, <commit>, <tree-ish>, etcMark Lodato, Mar 13, 2010
  13. 07/12 docs: use <tree> instead of <tree-ish>Mark Lodato, Mar 13, 2010
  14. 08/12 http-fetch docs: use <commit-id> consistentlyMark Lodato, Mar 13, 2010
  15. 09/12 docs: use <commit> instead of <commit-ish>Mark Lodato, Mar 13, 2010
  16. Junio C HamanoMar 13, 2010
  17. Mark LodatoMar 16, 2010
  18. 10/12 diff: use brackets for optional args in usageMark Lodato, Mar 13, 2010
  19. 11/12 docs: use ... instead of * for multiplicityMark Lodato, Mar 13, 2010
  20. 12/12 diff docs: remove <rev>{0,2} notationMark Lodato, Mar 13, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.