Thread (13 messages) flat view 13 messages, 1 author, 2016-06-15
DORMANTno replies

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

From: Mark Lodato <hidden>
Date: 2016-06-15 22:48:25
Subsystem: documentation, the rest · Maintainers: Jonathan Corbet, Linus Torvalds

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 <redacted>
---
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help