Add 'human' date format documentation
authorStephen P. Smith <ischis2@cox.net>
Mon, 21 Jan 2019 05:31:10 +0000 (22:31 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 22 Jan 2019 22:16:17 +0000 (14:16 -0800)
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>
Documentation/git-log.txt
Documentation/rev-list-options.txt
index 90761f169444c165f0e94ebc3b7731cd8d85d3f0..b02e922dc33d248493df4bf6e1bb42f342e38daa 100644 (file)
@@ -192,6 +192,10 @@ log.date::
        Default format for human-readable dates.  (Compare the
        `--date` option.)  Defaults to "default", which means to write
        dates like `Sat May 8 19:35:34 2010 -0500`.
++
+If the format is set to "auto:foo" and the pager is in use, format
+"foo" will be the used for the date format. Otherwise "default" will
+be used.
 
 log.follow::
        If `true`, `git log` will act as if the `--follow` option was used when
index 7b273635de2b5bf3e3ba6ade8bcca3068a216395..891aef96b4e1477db32074bf22adfa08f586c9d1 100644 (file)
@@ -830,6 +830,13 @@ Note that the `-local` option does not affect the seconds-since-epoch
 value (which is always measured in UTC), but does switch the accompanying
 timezone value.
 +
+`--date=human` shows the timezone if the timezone does not match the
+current time-zone, and doesn't print the whole date if that matches
+(ie skip printing year for dates that are "this year", but also skip
+the whole date itself if it's in the last few days and we can just say
+what weekday it was).  For older dates the hour and minute is also
+omitted.
++
 `--date=unix` shows the date as a Unix epoch timestamp (seconds since
 1970).  As with `--raw`, this is always in UTC and therefore `-local`
 has no effect.