Skip to content

Commit 83c9f95

Browse files
peffgitster
authored andcommitted
doc/rev-list-options: explain "-g" output formats
We document that asking for HEAD@{now} will switch the output to show HEAD@{timestamp}, but not that specifying `--date` has a similar effect, or that it can be overridden with HEAD@{0}. Let's do so. These rules come from 794151e (reflog-walk: always make HEAD@{0} show indexed selectors, 2012-05-04), though that is simply the culmination of years of these heuristics growing organically. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2b68222 commit 83c9f95

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

Documentation/rev-list-options.txt

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,25 @@ list.
252252
+
253253
With `--pretty` format other than `oneline` (for obvious reasons),
254254
this causes the output to have two extra lines of information
255-
taken from the reflog. By default, `ref@{Nth}` notation is
256-
used in the output. When the starting commit is specified as
257-
`ref@{now}`, output also uses `ref@{timestamp}` notation
258-
instead. Under `--pretty=oneline`, the commit message is
255+
taken from the reflog. The reflog designator in the output may be shown
256+
as `ref@{Nth}` (where `Nth` is the reverse-chronological index in the
257+
reflog) or as `ref@{timestamp}` (with the timestamp for that entry),
258+
depending on a few rules:
259+
+
260+
--
261+
1. If the starting point is specified as `ref@{Nth}`, show the index
262+
format.
263+
+
264+
2. If the starting point was specified as `ref@{now}`, show the
265+
timestamp format.
266+
+
267+
3. If neither was used, but `--date` was given on the command line, show
268+
the timestamp in the format requested by `--date`.
269+
+
270+
4. Otherwise, show the index format.
271+
--
272+
+
273+
Under `--pretty=oneline`, the commit message is
259274
prefixed with this information on the same line.
260275
This option cannot be combined with `--reverse`.
261276
See also linkgit:git-reflog[1].

0 commit comments

Comments
 (0)