Skip to content

Commit 2a407d7

Browse files
committed
Merge branch 'rr/shortlog-doc'
Update documentation for "log" and "shortlog". * rr/shortlog-doc: builtin/shortlog.c: make usage string consistent with log builtin/log.c: make usage string consistent with doc git-shortlog.txt: make SYNOPSIS match log, update OPTIONS git-log.txt: rewrite note on why "--" may be required git-log.txt: generalize <since>..<until> git-log.txt: order OPTIONS properly; move <since>..<until> revisions.txt: clarify the .. and ... syntax git-shortlog.txt: remove (-h|--help) from OPTIONS
2 parents f44014b + 0942d51 commit 2a407d7

File tree

5 files changed

+35
-22
lines changed

5 files changed

+35
-22
lines changed

Documentation/git-log.txt

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ git-log - Show commit logs
99
SYNOPSIS
1010
--------
1111
[verse]
12-
'git log' [<options>] [<since>..<until>] [[\--] <path>...]
12+
'git log' [<options>] [<revision range>] [[\--] <path>...]
1313

1414
DESCRIPTION
1515
-----------
@@ -24,13 +24,6 @@ each commit introduces are shown.
2424
OPTIONS
2525
-------
2626

27-
<since>..<until>::
28-
Show only commits between the named two commits. When
29-
either <since> or <until> is omitted, it defaults to
30-
`HEAD`, i.e. the tip of the current branch.
31-
For a more complete list of ways to spell <since>
32-
and <until>, see linkgit:gitrevisions[7].
33-
3427
--follow::
3528
Continue listing the history of a file beyond renames
3629
(works only for a single file).
@@ -69,14 +62,23 @@ produced by --stat etc.
6962
Note that only message is considered, if also a diff is shown
7063
its size is not included.
7164

65+
<revision range>::
66+
Show only commits in the specified revision range. When no
67+
<revision range> is specified, it defaults to `HEAD` (i.e. the
68+
whole history leading to the current commit). `origin..HEAD`
69+
specifies all the commits reachable from the current commit
70+
(i.e. `HEAD`), but not from `origin`. For a complete list of
71+
ways to spell <revision range>, see the "Specifying Ranges"
72+
section of linkgit:gitrevisions[7].
73+
7274
[\--] <path>...::
7375
Show only commits that are enough to explain how the files
7476
that match the specified paths came to be. See "History
7577
Simplification" below for details and other simplification
7678
modes.
7779
+
78-
To prevent confusion with options and branch names, paths may need to
79-
be prefixed with "\-- " to separate them from options or refnames.
80+
Paths may need to be prefixed with "\-- " to separate them from
81+
options or the revision range, when confusion arises.
8082

8183
include::rev-list-options.txt[]
8284

Documentation/git-shortlog.txt

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ git-shortlog - Summarize 'git log' output
88
SYNOPSIS
99
--------
1010
[verse]
11-
git log --pretty=short | 'git shortlog' [-h] [-n] [-s] [-e] [-w]
12-
'git shortlog' [-n|--numbered] [-s|--summary] [-e|--email] [-w[<width>[,<indent1>[,<indent2>]]]] <commit>...
11+
git log --pretty=short | 'git shortlog' [<options>]
12+
'git shortlog' [<options>] [<revision range>] [[\--] <path>...]
1313

1414
DESCRIPTION
1515
-----------
@@ -26,10 +26,6 @@ reference to the current repository.
2626
OPTIONS
2727
-------
2828

29-
-h::
30-
--help::
31-
Print a short usage message and exit.
32-
3329
-n::
3430
--numbered::
3531
Sort output according to the number of commits per author instead
@@ -60,6 +56,21 @@ OPTIONS
6056
If width is `0` (zero) then indent the lines of the output without wrapping
6157
them.
6258

59+
<revision range>::
60+
Show only commits in the specified revision range. When no
61+
<revision range> is specified, it defaults to `HEAD` (i.e. the
62+
whole history leading to the current commit). `origin..HEAD`
63+
specifies all the commits reachable from the current commit
64+
(i.e. `HEAD`), but not from `origin`. For a complete list of
65+
ways to spell <revision range>, see the "Specifying Ranges"
66+
section of linkgit:gitrevisions[7].
67+
68+
[\--] <path>...::
69+
Consider only commits that are enough to explain how the files
70+
that match the specified paths came to be.
71+
+
72+
Paths may need to be prefixed with "\-- " to separate them from
73+
options or the revision range, when confusion arises.
6374

6475
MAPPING AUTHORS
6576
---------------

Documentation/revisions.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,13 @@ To summarize:
244244

245245
'<rev1>..<rev2>'::
246246
Include commits that are reachable from <rev2> but exclude
247-
those that are reachable from <rev1>.
247+
those that are reachable from <rev1>. When either <rev1> or
248+
<rev2> is omitted, it defaults to 'HEAD'.
248249

249250
'<rev1>\...<rev2>'::
250251
Include commits that are reachable from either <rev1> or
251-
<rev2> but exclude those that are reachable from both.
252+
<rev2> but exclude those that are reachable from both. When
253+
either <rev1> or <rev2> is omitted, it defaults to 'HEAD'.
252254

253255
'<rev>{caret}@', e.g. 'HEAD{caret}@'::
254256
A suffix '{caret}' followed by an at sign is the same as listing

builtin/log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static const char *fmt_patch_subject_prefix = "PATCH";
3737
static const char *fmt_pretty;
3838

3939
static const char * const builtin_log_usage[] = {
40-
N_("git log [<options>] [<since>..<until>] [[--] <path>...]\n")
40+
N_("git log [<options>] [<revision range>] [[--] <path>...]\n")
4141
N_(" or: git show [options] <object>..."),
4242
NULL
4343
};

builtin/shortlog.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
#include "parse-options.h"
1111

1212
static char const * const shortlog_usage[] = {
13-
N_("git shortlog [-n] [-s] [-e] [-w] [rev-opts] [--] [<commit-id>... ]"),
14-
"",
15-
N_("[rev-opts] are documented in git-rev-list(1)"),
13+
N_("git shortlog [<options>] [<revision range>] [[--] [<path>...]]"),
1614
NULL
1715
};
1816

0 commit comments

Comments
 (0)