{"thread":{"id":"42907","subject":"[PATCH v2 0/6] reflog docs and date-formatting","startedAt":"2016-07-22T19:51:14Z","lastAt":"2016-07-27T20:17:58Z","messageCount":16,"participants":["Jeff King","Jakub Narębski","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":6},"messages":[{"id":"292002","messageId":"20160722195105.GA19542@sigill.intra.peff.net","threadId":"42907","inReplyTo":null,"subject":"[PATCH v2 0/6] reflog docs and date-formatting","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-07-22T19:51:05Z","receivedAt":"2016-07-22T19:51:14Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"This is a repost of the patches in:\n\n  http://thread.gmane.org/gmane.comp.version-control.git/299201/focus=299236\n\nsince I don't think they got picked up at all.\n\nThe contents are the same, but with one extra patch (the 4th) that was\nposted mid-discussion.\n\nThe only other review comment is that patch 5 might want to editorialize\nthe weirdness of \"raw-local\" more. I think I'm comfortable leaving it\nas-is based on my response in:\n\n  http://article.gmane.org/gmane.comp.version-control.git/299312\n\nbut I could be persuaded otherwise.\n\nThe final patch, \"--date=unix\" doesn't _really_ solve Ted's problem,\nbecause there's still no way to give multiple date formats in the same\nline, nor use \"%gd\" as both the reflog index and as the date. So I'm\nassuming he'll still build \"%gt\" or similar on top of this, and only in\nthe long run will we get to \"%(reflog-date:unix)\" or whatever.\n\nSo I think it's still valuable as a minor feature for other formatting\nneeds, and as a potential building block for later. The earlier patches\nare all immediately useful as clarifications.\n\n  [1/6]: doc/rev-list-options: clarify \"commit@{Nth}\" for \"-g\" option\n  [2/6]: doc/rev-list-options: explain \"-g\" output formats\n  [3/6]: doc/pretty-formats: describe index/time formats for %gd\n  [4/6]: doc/pretty-formats: explain shortening of %gd\n  [5/6]: date: document and test \"raw-local\" mode\n  [6/6]: date: add \"unix\" format\n\n-Peff\n"},{"id":"292003","messageId":"20160722195119.GA19648@sigill.intra.peff.net","threadId":"42907","inReplyTo":"20160722195105.GA19542@sigill.intra.peff.net","subject":"[PATCH v2 1/6] doc/rev-list-options: clarify \"commit@{Nth}\" for \"-g\" option","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-07-22T19:51:19Z","receivedAt":"2016-07-22T19:51:26Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"When \"log -g\" shows \"HEAD@{1}\", \"HEAD@{2}\", etc, calling\nthat \"commit@{Nth}\" is not really accurate. The \"HEAD\" part\nis really the refname. By saying \"commit\", a reader may\nmisunderstand that to mean something related to the specific\ncommit we are showing, not the ref whose reflog we are\ntraversing.\n\nWhile we're here, let's also switch these instances to use\nliteral backticks, as our style guide recommends. As a\nbonus, that lets us drop some asciidoc quoting.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n Documentation/rev-list-options.txt | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\nindex c5bd218..1b56253 100644\n--- a/Documentation/rev-list-options.txt\n+++ b/Documentation/rev-list-options.txt\n@@ -252,9 +252,9 @@ list.\n +\n With `--pretty` format other than `oneline` (for obvious reasons),\n this causes the output to have two extra lines of information\n-taken from the reflog.  By default, 'commit@\\{Nth}' notation is\n+taken from the reflog.  By default, `ref@{Nth}` notation is\n used in the output.  When the starting commit is specified as\n-'commit@\\{now}', output also uses 'commit@\\{timestamp}' notation\n+`ref@{now}`, output also uses `ref@{timestamp}` notation\n instead.  Under `--pretty=oneline`, the commit message is\n prefixed with this information on the same line.\n This option cannot be combined with `--reverse`.\n-- \n2.9.2.512.gc1ef750\n\n"},{"id":"292004","messageId":"20160722195132.GB19648@sigill.intra.peff.net","threadId":"42907","inReplyTo":"20160722195105.GA19542@sigill.intra.peff.net","subject":"[PATCH v2 2/6] doc/rev-list-options: explain \"-g\" output formats","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-07-22T19:51:32Z","receivedAt":"2016-07-22T19:51:52Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"We document that asking for HEAD@{now} will switch the\noutput to show HEAD@{timestamp}, but not that specifying\n`--date` has a similar effect, or that it can be overridden\nwith HEAD@{0}. Let's do so.\n\nThese rules come from 794151e (reflog-walk: always make\nHEAD@{0} show indexed selectors, 2012-05-04), though that is\nsimply the culmination of years of these heuristics growing\norganically.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n Documentation/rev-list-options.txt | 23 +++++++++++++++++++----\n 1 file changed, 19 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\nindex 1b56253..5d1de06 100644\n--- a/Documentation/rev-list-options.txt\n+++ b/Documentation/rev-list-options.txt\n@@ -252,10 +252,25 @@ list.\n +\n With `--pretty` format other than `oneline` (for obvious reasons),\n this causes the output to have two extra lines of information\n-taken from the reflog.  By default, `ref@{Nth}` notation is\n-used in the output.  When the starting commit is specified as\n-`ref@{now}`, output also uses `ref@{timestamp}` notation\n-instead.  Under `--pretty=oneline`, the commit message is\n+taken from the reflog.  The reflog designator in the output may be shown\n+as `ref@{Nth}` (where `Nth` is the reverse-chronological index in the\n+reflog) or as `ref@{timestamp}` (with the timestamp for that entry),\n+depending on a few rules:\n++\n+--\n+1. If the starting point is specified as `ref@{Nth}`, show the index\n+format.\n++\n+2. If the starting point was specified as `ref@{now}`, show the\n+timestamp format.\n++\n+3. If neither was used, but `--date` was given on the command line, show\n+the timestamp in the format requested by `--date`.\n++\n+4. Otherwise, show the index format.\n+--\n++\n+Under `--pretty=oneline`, the commit message is\n prefixed with this information on the same line.\n This option cannot be combined with `--reverse`.\n See also linkgit:git-reflog[1].\n-- \n2.9.2.512.gc1ef750\n\n"},{"id":"292005","messageId":"20160722195136.GC19648@sigill.intra.peff.net","threadId":"42907","inReplyTo":"20160722195105.GA19542@sigill.intra.peff.net","subject":"[PATCH v2 3/6] doc/pretty-formats: describe index/time formats for %gd","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-07-22T19:51:37Z","receivedAt":"2016-07-22T19:51:56Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The \"reflog selector\" format changes based on a series of\nheuristics, and that applies equally to both stock \"log -g\"\noutput, as well as \"--format=%gd\". The documentation for\n\"%gd\" doesn't cover this. Let's mention the multiple formats\nand refer the user back to the \"-g\" section for the complete\nrules.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n Documentation/pretty-formats.txt | 7 +++++--\n 1 file changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt\nindex 29b19b9..36a300a 100644\n--- a/Documentation/pretty-formats.txt\n+++ b/Documentation/pretty-formats.txt\n@@ -147,8 +147,11 @@ endif::git-rev-list[]\n   \"U\" for a good signature with unknown validity and \"N\" for no signature\n - '%GS': show the name of the signer for a signed commit\n - '%GK': show the key used to sign a signed commit\n-- '%gD': reflog selector, e.g., `refs/stash@{1}`\n-- '%gd': shortened reflog selector, e.g., `stash@{1}`\n+- '%gD': reflog selector, e.g., `refs/stash@{1}` or\n+  `refs/stash@{2 minutes ago`}; the format follows the rules described\n+  for the `-g` option\n+- '%gd': shortened reflog selector, e.g., `stash@{1}` or\n+  `stash@{2 minutes ago}`\n - '%gn': reflog identity name\n - '%gN': reflog identity name (respecting .mailmap, see\n   linkgit:git-shortlog[1] or linkgit:git-blame[1])\n-- \n2.9.2.512.gc1ef750\n\n"},{"id":"292006","messageId":"20160722195140.GD19648@sigill.intra.peff.net","threadId":"42907","inReplyTo":"20160722195105.GA19542@sigill.intra.peff.net","subject":"[PATCH v2 4/6] doc/pretty-formats: explain shortening of %gd","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-07-22T19:51:41Z","receivedAt":"2016-07-22T19:51:57Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The actual shortening rules aren't that interesting and\nprobably not worth getting into (I gloss over them here as\n\"shortened for human readability\"). But the fact that %gD\nshows whatever you gave on the command line is subtle and\nworth mentioning. Since most people will feed a shortened\nrefname in the first place, it otherwise makes it hard to\nunderstand the difference between the two.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n Documentation/pretty-formats.txt | 9 ++++++---\n 1 file changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt\nindex 36a300a..b95d67e 100644\n--- a/Documentation/pretty-formats.txt\n+++ b/Documentation/pretty-formats.txt\n@@ -149,9 +149,12 @@ endif::git-rev-list[]\n - '%GK': show the key used to sign a signed commit\n - '%gD': reflog selector, e.g., `refs/stash@{1}` or\n   `refs/stash@{2 minutes ago`}; the format follows the rules described\n-  for the `-g` option\n-- '%gd': shortened reflog selector, e.g., `stash@{1}` or\n-  `stash@{2 minutes ago}`\n+  for the `-g` option. The portion before the `@` is the refname as\n+  given on the command line (so `git log -g refs/heads/master` would\n+  yield `refs/heads/master@{0}`).\n+- '%gd': shortened reflog selector; same as `%gD`, but the refname\n+  portion is shortened for human readability (so `refs/heads/master`\n+  becomes just `master`).\n - '%gn': reflog identity name\n - '%gN': reflog identity name (respecting .mailmap, see\n   linkgit:git-shortlog[1] or linkgit:git-blame[1])\n-- \n2.9.2.512.gc1ef750\n\n"},{"id":"292007","messageId":"20160722195144.GE19648@sigill.intra.peff.net","threadId":"42907","inReplyTo":"20160722195105.GA19542@sigill.intra.peff.net","subject":"[PATCH v2 5/6] date: document and test \"raw-local\" mode","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-07-22T19:51:45Z","receivedAt":"2016-07-22T19:51:58Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The \"raw\" format shows a Unix epoch timestamp, but with a\ntimezone tacked on. The timestamp is not _in_ that zone, but\nit is extra information about the time (by default, the zone\nthe author was in).\n\nThe documentation claims that \"raw-local\" does not work. It\ndoes, but the end result is rather subtle. Let's describe it\nin better detail, and test to make sure it works (namely,\nthe epoch time doesn't change, but the zone does).\n\nWhile we are rewording the documentation in this area, let's\nnot use the phrase \"does not work\" for the remaining option,\n\"--relative\". It's vague; do we accept it or not? We do\naccept it, but it has no effect (which is a reasonable\noutcome).\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n Documentation/rev-list-options.txt | 9 ++++++---\n t/t0006-date.sh                    | 1 +\n 2 files changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\nindex 5d1de06..3ec75d4 100644\n--- a/Documentation/rev-list-options.txt\n+++ b/Documentation/rev-list-options.txt\n@@ -725,8 +725,8 @@ include::pretty-options.txt[]\n \t`iso-local`), the user's local time zone is used instead.\n +\n `--date=relative` shows dates relative to the current time,\n-e.g. ``2 hours ago''. The `-local` option cannot be used with\n-`--raw` or `--relative`.\n+e.g. ``2 hours ago''. The `-local` option has no effect for\n+`--relative`.\n +\n `--date=local` is an alias for `--date=default-local`.\n +\n@@ -746,7 +746,10 @@ format, often found in email messages.\n +\n `--date=short` shows only the date, but not the time, in `YYYY-MM-DD` format.\n +\n-`--date=raw` shows the date in the internal raw Git format `%s %z` format.\n+`--date=raw` shows the date in the internal raw Git format `%s %z`\n+format. Note that the `-local` option does not affect the\n+seconds-since-epoch value (which is always measured in UTC), but does\n+switch the accompanying timezone value.\n +\n `--date=format:...` feeds the format `...` to your system `strftime`.\n Use `--date=format:%c` to show the date in your system locale's\ndiff --git a/t/t0006-date.sh b/t/t0006-date.sh\nindex 4c8cf58..482fec0 100755\n--- a/t/t0006-date.sh\n+++ b/t/t0006-date.sh\n@@ -47,6 +47,7 @@ check_show short \"$TIME\" '2016-06-15'\n check_show default \"$TIME\" 'Wed Jun 15 16:13:20 2016 +0200'\n check_show raw \"$TIME\" '1466000000 +0200'\n check_show iso-local \"$TIME\" '2016-06-15 14:13:20 +0000'\n+check_show raw-local \"$TIME\" '1466000000 +0000'\n \n # arbitrary time absurdly far in the future\n FUTURE=\"5758122296 -0400\"\n-- \n2.9.2.512.gc1ef750\n\n"},{"id":"292008","messageId":"20160722195149.GF19648@sigill.intra.peff.net","threadId":"42907","inReplyTo":"20160722195105.GA19542@sigill.intra.peff.net","subject":"[PATCH v2 6/6] date: add \"unix\" format","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-07-22T19:51:49Z","receivedAt":"2016-07-22T19:52:04Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"We already have \"--date=raw\", which is a Unix epoch\ntimestamp plus a contextual timezone (either the author's or\nthe local). But one may not care about the timezone and just\nwant the epoch timestamp by itself. It's not hard to parse\nthe two apart, but if you are using a pretty-print format,\nyou may want git to show the \"finished\" form that the user\nwill see.\n\nWe can accomodate this by adding a new date format, \"unix\",\nwhich is basically \"raw\" without the timezone.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n Documentation/rev-list-options.txt | 4 ++++\n builtin/blame.c                    | 3 +++\n cache.h                            | 3 ++-\n date.c                             | 8 ++++++++\n t/t0006-date.sh                    | 2 ++\n 5 files changed, 19 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\nindex 3ec75d4..8b1c946 100644\n--- a/Documentation/rev-list-options.txt\n+++ b/Documentation/rev-list-options.txt\n@@ -751,6 +751,10 @@ format. Note that the `-local` option does not affect the\n seconds-since-epoch value (which is always measured in UTC), but does\n switch the accompanying timezone value.\n +\n+`--date=unix` shows the date as a Unix epoch timestamp (seconds since\n+1970).  As with `--raw`, this is always in UTC and therefore `-local`\n+has no effect.\n++\n `--date=format:...` feeds the format `...` to your system `strftime`.\n Use `--date=format:%c` to show the date in your system locale's\n preferred format.  See the `strftime` manual for a complete list of\ndiff --git a/builtin/blame.c b/builtin/blame.c\nindex 8fec0e1..cb08127 100644\n--- a/builtin/blame.c\n+++ b/builtin/blame.c\n@@ -2625,6 +2625,9 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \tcase DATE_RAW:\n \t\tblame_date_width = sizeof(\"1161298804 -0700\");\n \t\tbreak;\n+\tcase DATE_UNIX:\n+\t\tblame_date_width = sizeof(\"1161298804\");\n+\t\tbreak;\n \tcase DATE_SHORT:\n \t\tblame_date_width = sizeof(\"2006-10-19\");\n \t\tbreak;\ndiff --git a/cache.h b/cache.h\nindex 2bf97cc..dd587b2 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1224,7 +1224,8 @@ struct date_mode {\n \t\tDATE_ISO8601_STRICT,\n \t\tDATE_RFC2822,\n \t\tDATE_STRFTIME,\n-\t\tDATE_RAW\n+\t\tDATE_RAW,\n+\t\tDATE_UNIX\n \t} type;\n \tconst char *strftime_fmt;\n \tint local;\ndiff --git a/date.c b/date.c\nindex 4c7aa9b..a996331 100644\n--- a/date.c\n+++ b/date.c\n@@ -177,6 +177,12 @@ const char *show_date(unsigned long time, int tz, const struct date_mode *mode)\n \tstruct tm *tm;\n \tstatic struct strbuf timebuf = STRBUF_INIT;\n \n+\tif (mode->type == DATE_UNIX) {\n+\t\tstrbuf_reset(&timebuf);\n+\t\tstrbuf_addf(&timebuf, \"%lu\", time);\n+\t\treturn timebuf.buf;\n+\t}\n+\n \tif (mode->local)\n \t\ttz = local_tzoffset(time);\n \n@@ -792,6 +798,8 @@ static enum date_mode_type parse_date_type(const char *format, const char **end)\n \t\treturn DATE_NORMAL;\n \tif (skip_prefix(format, \"raw\", end))\n \t\treturn DATE_RAW;\n+\tif (skip_prefix(format, \"unix\", end))\n+\t\treturn DATE_UNIX;\n \tif (skip_prefix(format, \"format\", end))\n \t\treturn DATE_STRFTIME;\n \ndiff --git a/t/t0006-date.sh b/t/t0006-date.sh\nindex 482fec0..c0c9108 100755\n--- a/t/t0006-date.sh\n+++ b/t/t0006-date.sh\n@@ -46,8 +46,10 @@ check_show rfc2822 \"$TIME\" 'Wed, 15 Jun 2016 16:13:20 +0200'\n check_show short \"$TIME\" '2016-06-15'\n check_show default \"$TIME\" 'Wed Jun 15 16:13:20 2016 +0200'\n check_show raw \"$TIME\" '1466000000 +0200'\n+check_show unix \"$TIME\" '1466000000'\n check_show iso-local \"$TIME\" '2016-06-15 14:13:20 +0000'\n check_show raw-local \"$TIME\" '1466000000 +0000'\n+check_show unix-local \"$TIME\" '1466000000'\n \n # arbitrary time absurdly far in the future\n FUTURE=\"5758122296 -0400\"\n-- \n2.9.2.512.gc1ef750\n"},{"id":"292036","messageId":"579343C9.1040902@gmail.com","threadId":"42907","inReplyTo":"20160722195144.GE19648@sigill.intra.peff.net","subject":"Re: [PATCH v2 5/6] date: document and test \"raw-local\" mode","fromName":"Jakub Narębski","fromEmail":"jnareb@gmail.com","sentAt":"2016-07-23T10:15:37Z","receivedAt":"2016-07-23T10:15:55Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"W dniu 2016-07-22 o 21:51, Jeff King pisze:\n\n> The \"raw\" format shows a Unix epoch timestamp, but with a\n> timezone tacked on. The timestamp is not _in_ that zone, but\n> it is extra information about the time (by default, the zone\n> the author was in).\n\nI would say that \"Unix time\" (name according to Wikipedia) is\nzone-less, but the information is correct.\n\n> \n> The documentation claims that \"raw-local\" does not work. It\n> does, but the end result is rather subtle. Let's describe it\n> in better detail, and test to make sure it works (namely,\n> the epoch time doesn't change, but the zone does).\n\nSubtle, and not very useful (unless you want to know your\nown timezone difference)... or do we adjust timezone offset\nshown across DST change for the locale?\n\n> \n> While we are rewording the documentation in this area, let's\n> not use the phrase \"does not work\" for the remaining option,\n> \"--relative\". It's vague; do we accept it or not? We do\n> accept it, but it has no effect (which is a reasonable\n> outcome).\n\nAnyway, replacing vague \"does not work\" with explanation of\nwhat is the result is a very good idea.\n\n> \n> Signed-off-by: Jeff King <peff@peff.net>\n> ---\n>  Documentation/rev-list-options.txt | 9 ++++++---\n>  t/t0006-date.sh                    | 1 +\n>  2 files changed, 7 insertions(+), 3 deletions(-)\n> \n> diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\n> index 5d1de06..3ec75d4 100644\n> --- a/Documentation/rev-list-options.txt\n> +++ b/Documentation/rev-list-options.txt\n> @@ -725,8 +725,8 @@ include::pretty-options.txt[]\n>  \t`iso-local`), the user's local time zone is used instead.\n>  +\n>  `--date=relative` shows dates relative to the current time,\n> -e.g. ``2 hours ago''. The `-local` option cannot be used with\n> -`--raw` or `--relative`.\n> +e.g. ``2 hours ago''. The `-local` option has no effect for\n> +`--relative`.\n\nDo I understand it correctly: --relative is a short form for more\ngeneric --date=relative (which probably should be spelled \n--date-format=relative), and that --date=relative-local is the\nsame as --date=relative, that is *-local suffix does not change\nhow date is formatted?\n\nBecause I don't think you can say --relative-local (\"The `-local`\noption has no effect on `--relative`\"), can you?\n\nNevertheless the proposed change is definite improvement.\n\n>  +\n>  `--date=local` is an alias for `--date=default-local`.\n>  +\n> @@ -746,7 +746,10 @@ format, often found in email messages.\n>  +\n>  `--date=short` shows only the date, but not the time, in `YYYY-MM-DD` format.\n>  +\n> -`--date=raw` shows the date in the internal raw Git format `%s %z` format.\n> +`--date=raw` shows the date in the internal raw Git format `%s %z`\n> +format. Note that the `-local` option does not affect the\n> +seconds-since-epoch value (which is always measured in UTC), but does\n> +switch the accompanying timezone value.\n\nWhich is correct, logical, and next to useless, I think.\n\n\nBTW. one kind of format that Git does not support (I think) is the\nvarying kind, where the precision changes with the distance from now,\nso that we can get most precision in limited width.  That's what\n`ls --long` does:\n\n * 'Jun 29 16:47' for dates falling in current year (more precision)\n * 'Nov 23  2015' for dates outside (less precision, same width)\n\nMany other programs switch from relative to absolute time when date\nin question is far in the past that relative is not very good.\n\n>  +\n>  `--date=format:...` feeds the format `...` to your system `strftime`.\n>  Use `--date=format:%c` to show the date in your system locale's\n> diff --git a/t/t0006-date.sh b/t/t0006-date.sh\n> index 4c8cf58..482fec0 100755\n> --- a/t/t0006-date.sh\n> +++ b/t/t0006-date.sh\n> @@ -47,6 +47,7 @@ check_show short \"$TIME\" '2016-06-15'\n>  check_show default \"$TIME\" 'Wed Jun 15 16:13:20 2016 +0200'\n>  check_show raw \"$TIME\" '1466000000 +0200'\n>  check_show iso-local \"$TIME\" '2016-06-15 14:13:20 +0000'\n> +check_show raw-local \"$TIME\" '1466000000 +0000'\n>  \n>  # arbitrary time absurdly far in the future\n>  FUTURE=\"5758122296 -0400\"\n> \n\n"},{"id":"292245","messageId":"20160726184746.GA678@sigill.intra.peff.net","threadId":"42907","inReplyTo":"579343C9.1040902@gmail.com","subject":"Re: [PATCH v2 5/6] date: document and test \"raw-local\" mode","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-07-26T18:47:46Z","receivedAt":"2016-07-26T18:47:55Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Jul 23, 2016 at 12:15:37PM +0200, Jakub Narębski wrote:\n\n> > diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\n> > index 5d1de06..3ec75d4 100644\n> > --- a/Documentation/rev-list-options.txt\n> > +++ b/Documentation/rev-list-options.txt\n> > @@ -725,8 +725,8 @@ include::pretty-options.txt[]\n> >  \t`iso-local`), the user's local time zone is used instead.\n> >  +\n> >  `--date=relative` shows dates relative to the current time,\n> > -e.g. ``2 hours ago''. The `-local` option cannot be used with\n> > -`--raw` or `--relative`.\n> > +e.g. ``2 hours ago''. The `-local` option has no effect for\n> > +`--relative`.\n> \n> Do I understand it correctly: --relative is a short form for more\n> generic --date=relative (which probably should be spelled \n> --date-format=relative), and that --date=relative-local is the\n> same as --date=relative, that is *-local suffix does not change\n> how date is formatted?\n> \n> Because I don't think you can say --relative-local (\"The `-local`\n> option has no effect on `--relative`\"), can you?\n\nAll correct. There is no --relative-local because \"--relative\" is a\nhistorical artifact. We could support --foo for every --date=foo, but I\ndon't think there is a reason to do so (and reasons not to, like\navoiding cluttering the option space).\n\n> > -`--date=raw` shows the date in the internal raw Git format `%s %z` format.\n> > +`--date=raw` shows the date in the internal raw Git format `%s %z`\n> > +format. Note that the `-local` option does not affect the\n> > +seconds-since-epoch value (which is always measured in UTC), but does\n> > +switch the accompanying timezone value.\n> \n> Which is correct, logical, and next to useless, I think.\n\nThis was discussed in the earlier review. It's basically only useful if\nyou are feeding the output to another script which will format the date\nand want to change what that script shows.\n\n> BTW. one kind of format that Git does not support (I think) is the\n> varying kind, where the precision changes with the distance from now,\n> so that we can get most precision in limited width.  That's what\n> `ls --long` does:\n> \n>  * 'Jun 29 16:47' for dates falling in current year (more precision)\n>  * 'Nov 23  2015' for dates outside (less precision, same width)\n> \n> Many other programs switch from relative to absolute time when date\n> in question is far in the past that relative is not very good.\n\nYes, this was discussed on the list not too long ago. I think it would\nbe useful, but is obviously orthogonal to this series.\n\n-Peff\n"},{"id":"292311","messageId":"5798AA7C.6050107@gmail.com","threadId":"42907","inReplyTo":"20160726184746.GA678@sigill.intra.peff.net","subject":"Re: [PATCH v2 5/6] date: document and test \"raw-local\" mode","fromName":"Jakub Narębski","fromEmail":"jnareb@gmail.com","sentAt":"2016-07-27T12:35:08Z","receivedAt":"2016-07-27T12:36:13Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"W dniu 2016-07-26 o 20:47, Jeff King pisze:\n> On Sat, Jul 23, 2016 at 12:15:37PM +0200, Jakub Narębski wrote:\n> \n>>> diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\n>>> index 5d1de06..3ec75d4 100644\n>>> --- a/Documentation/rev-list-options.txt\n>>> +++ b/Documentation/rev-list-options.txt\n>>> @@ -725,8 +725,8 @@ include::pretty-options.txt[]\n>>>  \t`iso-local`), the user's local time zone is used instead.\n>>>  +\n>>>  `--date=relative` shows dates relative to the current time,\n>>> -e.g. ``2 hours ago''. The `-local` option cannot be used with\n>>> -`--raw` or `--relative`.\n>>> +e.g. ``2 hours ago''. The `-local` option has no effect for\n>>> +`--relative`.\n>>\n>> Do I understand it correctly: --relative is a short form for more\n>> generic --date=relative (which probably should be spelled \n>> --date-format=relative), and that --date=relative-local is the\n>> same as --date=relative, that is *-local suffix does not change\n>> how date is formatted?\n>>\n>> Because I don't think you can say --relative-local (\"The `-local`\n>> option has no effect on `--relative`\"), can you?\n> \n> All correct. There is no --relative-local because \"--relative\" is a\n> historical artifact. We could support --foo for every --date=foo, but I\n> don't think there is a reason to do so (and reasons not to, like\n> avoiding cluttering the option space).\n\nSo shouldn't the last sentence \n\n  \"The `-local` option has no effect for `--relative`.\" \n\nbe rather\n\n \"The `-local` option has no effect for `--date=relative`.\"\n\nThough this might be just me being overly nitpicky...\n\n-- \nJakub Narębski\n\n"},{"id":"292314","messageId":"20160727134441.GB14928@sigill.intra.peff.net","threadId":"42907","inReplyTo":"5798AA7C.6050107@gmail.com","subject":"[PATCH v3 5/6] date: document and test \"raw-local\" mode","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-07-27T13:44:41Z","receivedAt":"2016-07-27T13:44:48Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jul 27, 2016 at 02:35:08PM +0200, Jakub Narębski wrote:\n\n> > All correct. There is no --relative-local because \"--relative\" is a\n> > historical artifact. We could support --foo for every --date=foo, but I\n> > don't think there is a reason to do so (and reasons not to, like\n> > avoiding cluttering the option space).\n> \n> So shouldn't the last sentence \n> \n>   \"The `-local` option has no effect for `--relative`.\" \n> \n> be rather\n> \n>  \"The `-local` option has no effect for `--date=relative`.\"\n\nAh, I see. I didn't realize that's what you are getting at. Yes, it\nwould be more accurate. That's not a new problem introduced by my patch;\nI just happened to be touching that sentence for other reasons. But the\npatch does try to clean up the text in general, so it seems like a good\ntime to make this fix, too.\n\nSince it looks like this is not even in 'next' yet, here is a\nreplacement for the 5th patch (second from the top) of the\njk/reflog-date topic.\n\n-- >8 --\nSubject: [PATCH] date: document and test \"raw-local\" mode\n\nThe \"raw\" format shows a Unix epoch timestamp, but with a\ntimezone tacked on. The timestamp is not _in_ that zone, but\nit is extra information about the time (by default, the zone\nthe author was in).\n\nThe documentation claims that \"raw-local\" does not work. It\ndoes, but the end result is rather subtle. Let's describe it\nin better detail, and test to make sure it works (namely,\nthe epoch time doesn't change, but the zone does).\n\nWhile we are rewording the documentation in this area, let's\nnot use the phrase \"does not work\" for the remaining option,\n\"--date=relative\". It's vague; do we accept it or not? We do\naccept it, but it has no effect (which is a reasonable\noutcome). We should also refer to the option not as\n\"--relative\" (which is the historical synonym, and does not\ntake \"-local\" at all), but as \"--date=relative\".\n\nHelped-by: Jakub Narębski <jnareb@gmail.com>\nSigned-off-by: Jeff King <peff@peff.net>\n---\n Documentation/rev-list-options.txt | 9 ++++++---\n t/t0006-date.sh                    | 1 +\n 2 files changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\nindex 5d1de06..04c7c64 100644\n--- a/Documentation/rev-list-options.txt\n+++ b/Documentation/rev-list-options.txt\n@@ -725,8 +725,8 @@ include::pretty-options.txt[]\n \t`iso-local`), the user's local time zone is used instead.\n +\n `--date=relative` shows dates relative to the current time,\n-e.g. ``2 hours ago''. The `-local` option cannot be used with\n-`--raw` or `--relative`.\n+e.g. ``2 hours ago''. The `-local` option has no effect for\n+`--date=relative`.\n +\n `--date=local` is an alias for `--date=default-local`.\n +\n@@ -746,7 +746,10 @@ format, often found in email messages.\n +\n `--date=short` shows only the date, but not the time, in `YYYY-MM-DD` format.\n +\n-`--date=raw` shows the date in the internal raw Git format `%s %z` format.\n+`--date=raw` shows the date in the internal raw Git format `%s %z`\n+format. Note that the `-local` option does not affect the\n+seconds-since-epoch value (which is always measured in UTC), but does\n+switch the accompanying timezone value.\n +\n `--date=format:...` feeds the format `...` to your system `strftime`.\n Use `--date=format:%c` to show the date in your system locale's\ndiff --git a/t/t0006-date.sh b/t/t0006-date.sh\nindex 4c8cf58..482fec0 100755\n--- a/t/t0006-date.sh\n+++ b/t/t0006-date.sh\n@@ -47,6 +47,7 @@ check_show short \"$TIME\" '2016-06-15'\n check_show default \"$TIME\" 'Wed Jun 15 16:13:20 2016 +0200'\n check_show raw \"$TIME\" '1466000000 +0200'\n check_show iso-local \"$TIME\" '2016-06-15 14:13:20 +0000'\n+check_show raw-local \"$TIME\" '1466000000 +0000'\n \n # arbitrary time absurdly far in the future\n FUTURE=\"5758122296 -0400\"\n-- \n2.9.2.607.g98dce7b\n\n"},{"id":"292362","messageId":"xmqq37mux3mz.fsf@gitster.mtv.corp.google.com","threadId":"42907","inReplyTo":"20160727134441.GB14928@sigill.intra.peff.net","subject":"Re: [PATCH v3 5/6] date: document and test \"raw-local\" mode","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-07-27T19:49:40Z","receivedAt":"2016-07-27T19:49:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> +e.g. ``2 hours ago''. The `-local` option has no effect for\n> +`--date=relative`.\n\nGood.\n\n> @@ -746,7 +746,10 @@ format, often found in email messages.\n>  +\n>  `--date=short` shows only the date, but not the time, in `YYYY-MM-DD` format.\n>  +\n> -`--date=raw` shows the date in the internal raw Git format `%s %z` format.\n> +`--date=raw` shows the date in the internal raw Git format `%s %z`\n> +format. Note that the `-local` option does not affect the\n> +seconds-since-epoch value (which is always measured in UTC), but does\n> +switch the accompanying timezone value.\n\nNot your fault, but \"internal raw Git format X format\" sounds a bit\nclunky.\n\n\tshows the date in `%s %z` format (seconds since 1970-01-01\n\t00:00:00 UTC, space, timezone as sign and four digits)\n        \nor something like that?  I suspect %s is not a POSIX-kosher strftime\nconversion specifier, so from that point of view, perhaps making the\ntext the authoritative description and demote the format string as a\ncomment to help those who know strfmt, i.e.\n\n\tshows the date as seconds since 1970-01-01 00:00:00 UTC,\n\tspace, timezone as sign and four digits (i.e. as if the\n\ttimestamp were formatted with `strftime(\"%s %z\")`).\n\nperhaps?\n\n"},{"id":"292363","messageId":"20160727195703.GA8141@sigill.intra.peff.net","threadId":"42907","inReplyTo":"xmqq37mux3mz.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v3 5/6] date: document and test \"raw-local\" mode","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-07-27T19:57:03Z","receivedAt":"2016-07-27T19:57:26Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jul 27, 2016 at 12:49:40PM -0700, Junio C Hamano wrote:\n\n> > @@ -746,7 +746,10 @@ format, often found in email messages.\n> >  +\n> >  `--date=short` shows only the date, but not the time, in `YYYY-MM-DD` format.\n> >  +\n> > -`--date=raw` shows the date in the internal raw Git format `%s %z` format.\n> > +`--date=raw` shows the date in the internal raw Git format `%s %z`\n> > +format. Note that the `-local` option does not affect the\n> > +seconds-since-epoch value (which is always measured in UTC), but does\n> > +switch the accompanying timezone value.\n> \n> Not your fault, but \"internal raw Git format X format\" sounds a bit\n> clunky.\n\nYeah, I also noticed that while writing the original, but it just\ncrossed over my line of \"if I fix everything I don't like, this series\nwill never get out the door\". :)\n\n> \tshows the date in `%s %z` format (seconds since 1970-01-01\n> \t00:00:00 UTC, space, timezone as sign and four digits)\n>         \n> or something like that?  I suspect %s is not a POSIX-kosher strftime\n> conversion specifier, so from that point of view, perhaps making the\n> text the authoritative description and demote the format string as a\n> comment to help those who know strfmt, i.e.\n> \n> \tshows the date as seconds since 1970-01-01 00:00:00 UTC,\n> \tspace, timezone as sign and four digits (i.e. as if the\n> \ttimestamp were formatted with `strftime(\"%s %z\")`).\n\nYeah, I think referring to \"%s %z\" is pretty bad, as it's meaningless to\npeople who don't know strftime() off the top of their head, and %s isn't\neven portable.\n\nThe second option you've shown here is much better, and I think this is\nworth fixing (and it should be in a new patch, and can go on top of the\nothers).\n\nI'm not sure if it's worth calling out more clearly what the timezone\nmeans, since the epoch seconds are in UTC, as you noted here. The\nfollow-on sentence explains what \"-local\" does, but not what it means in\nthe non-local variant.\n\n-Peff\n"},{"id":"292367","messageId":"xmqqtwfavo21.fsf@gitster.mtv.corp.google.com","threadId":"42907","inReplyTo":"20160727195703.GA8141@sigill.intra.peff.net","subject":"Re: [PATCH v3 5/6] date: document and test \"raw-local\" mode","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-07-27T20:11:34Z","receivedAt":"2016-07-27T20:11:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> The second option you've shown here is much better, and I think this is\n> worth fixing (and it should be in a new patch, and can go on top of the\n> others).\n>\n> I'm not sure if it's worth calling out more clearly what the timezone\n> means, since the epoch seconds are in UTC, as you noted here. The\n> follow-on sentence explains what \"-local\" does, but not what it means in\n> the non-local variant.\n\nHmm, that is another thing we can incrementally improve, I guess.\n\nHere is 7/6 I've tentatively queued.  Note that I minimized the\nreflowing of the paragraph you did in 5/6 so the patch may not apply\ncleanly to your tree.\n\n-- >8 --\nSubject: [PATCH] date: clarify --date=raw description\n\n\"... in the internal raw Git format `%s %z` format.\" was clunky in\nrepeating \"format\" twice, and would not have helped those who do not\nknow that these are strftime(3) conversion specifiers.\n\nExplain them with words, and demote the mention of `%s %z` to a\nhint to help those who know them.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Documentation/rev-list-options.txt | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\nindex fd86ed1..d55e3ae 100644\n--- a/Documentation/rev-list-options.txt\n+++ b/Documentation/rev-list-options.txt\n@@ -746,7 +746,9 @@ format, often found in email messages.\n +\n `--date=short` shows only the date, but not the time, in `YYYY-MM-DD` format.\n +\n-`--date=raw` shows the date in the internal raw Git format `%s %z` format.\n+`--date=raw` shows the date as seconds since 1970-01-01 00:00:00 UTC,\n+space, timezone as sign and four digits (i.e. as if the timestamp were\n+formatted with `strftime(\"%s %z\")`).\n Note that the `-local` option does not affect the seconds-since-epoch\n value (which is always measured in UTC), but does switch the accompanying\n timezone value.\n-- \n2.9.2-654-g4c312ab\n\n"},{"id":"292369","messageId":"20160727201651.GA26984@sigill.intra.peff.net","threadId":"42907","inReplyTo":"xmqqtwfavo21.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v3 5/6] date: document and test \"raw-local\" mode","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-07-27T20:16:52Z","receivedAt":"2016-07-27T20:16:58Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jul 27, 2016 at 01:11:34PM -0700, Junio C Hamano wrote:\n\n> -- >8 --\n> Subject: [PATCH] date: clarify --date=raw description\n> \n> \"... in the internal raw Git format `%s %z` format.\" was clunky in\n> repeating \"format\" twice, and would not have helped those who do not\n> know that these are strftime(3) conversion specifiers.\n> \n> Explain them with words, and demote the mention of `%s %z` to a\n> hint to help those who know them.\n\nGood explanation.\n\n> diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\n> index fd86ed1..d55e3ae 100644\n> --- a/Documentation/rev-list-options.txt\n> +++ b/Documentation/rev-list-options.txt\n> @@ -746,7 +746,9 @@ format, often found in email messages.\n>  +\n>  `--date=short` shows only the date, but not the time, in `YYYY-MM-DD` format.\n>  +\n> -`--date=raw` shows the date in the internal raw Git format `%s %z` format.\n> +`--date=raw` shows the date as seconds since 1970-01-01 00:00:00 UTC,\n> +space, timezone as sign and four digits (i.e. as if the timestamp were\n> +formatted with `strftime(\"%s %z\")`).\n\nI do find this by itself a little hard to parse. Maybe:\n\n  `--date=raw` shows the date as seconds since the epoch (1970-01-01\n  00:00:00 UTC), followed by a space, and then the timezone as an offset\n  from UTC (a `+` or `-` with four digits; the first two are hours, and\n  the second two are minutes). I.e., as if the timestamp were formatted\n  with `strftime(\"%s %z\")`).\n\n-Peff\n"},{"id":"292370","messageId":"xmqqpopyvnrm.fsf@gitster.mtv.corp.google.com","threadId":"42907","inReplyTo":"20160727201651.GA26984@sigill.intra.peff.net","subject":"Re: [PATCH v3 5/6] date: document and test \"raw-local\" mode","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-07-27T20:17:49Z","receivedAt":"2016-07-27T20:17:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> I do find this by itself a little hard to parse. Maybe:\n>\n>   `--date=raw` shows the date as seconds since the epoch (1970-01-01\n>   00:00:00 UTC), followed by a space, and then the timezone as an offset\n>   from UTC (a `+` or `-` with four digits; the first two are hours, and\n>   the second two are minutes). I.e., as if the timestamp were formatted\n>   with `strftime(\"%s %z\")`).\n\nI also had trouble with what I wrote.  Thanks for a great help.\n\n"}]}