Skip to content

Commit 038a878

Browse files
Stephen P. Smithgitster
authored andcommitted
Add 'human' date format documentation
Display date and time information in a format similar to how people write dates in other contexts. If the year isn't specified then, the reader infers the date is given is in the current year. By not displaying the redundant information, the reader concentrates on the information that is different. The patch reports relative dates based on information inferred from the date on the machine running the git command at the time the command is executed. While the format is more useful to humans by dropping inferred information, there is nothing that makes it actually human. If the 'relative' date format wasn't already implemented then using 'relative' would have been appropriate. Signed-off-by: Stephen P. Smith <ischis2@cox.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 2fd7c22 commit 038a878

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Documentation/git-log.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ log.date::
192192
Default format for human-readable dates. (Compare the
193193
`--date` option.) Defaults to "default", which means to write
194194
dates like `Sat May 8 19:35:34 2010 -0500`.
195+
+
196+
If the format is set to "auto:foo" and the pager is in use, format
197+
"foo" will be the used for the date format. Otherwise "default" will
198+
be used.
195199

196200
log.follow::
197201
If `true`, `git log` will act as if the `--follow` option was used when

Documentation/rev-list-options.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,13 @@ Note that the `-local` option does not affect the seconds-since-epoch
830830
value (which is always measured in UTC), but does switch the accompanying
831831
timezone value.
832832
+
833+
`--date=human` shows the timezone if the timezone does not match the
834+
current time-zone, and doesn't print the whole date if that matches
835+
(ie skip printing year for dates that are "this year", but also skip
836+
the whole date itself if it's in the last few days and we can just say
837+
what weekday it was). For older dates the hour and minute is also
838+
omitted.
839+
+
833840
`--date=unix` shows the date as a Unix epoch timestamp (seconds since
834841
1970). As with `--raw`, this is always in UTC and therefore `-local`
835842
has no effect.

0 commit comments

Comments
 (0)