git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC 0/5] Date Mode: Add --time-zone; deprecate --date=local

From
Michael Witten <mfwitten@gmail.com>
Date
Apr 20, 2011, 02:53 UTC
Message-ID
<0f30e048-7dd2-4aff-8c1f-00bf0dfa3d34-mfwitten@gmail.com>

One of the possible values for a date format is `local', which specifies that a date should be output as though the date format were instead `default' but in terms of the user's time zone instead of the time zone stored by git; clearly, then, `local' does not really provide just another format, but rather the combination of 2 specifications:

  * A format for the date (`default')
  * A time zone in which to interpret the date (`local', if you will)

Interestingly, the existing documentation suggests that the original purpose of the `--date' option was to specify the time zone rather than a format:

  $ git grep -hC1 '`--date=local`\|`--date=default`' \
  >   6ceb270ce6f65cf4bc2a22830f96e0cc838b3fec       \
  >   -- Documentation/rev-list-options.txt
  +
  `--date=local` shows timestamps in user's local timezone.
  +
  --
  +
  `--date=default` shows timestamps in the original timezone
  (either committer's or author's).

This patch series reimplements the original purpose of `--date' by allowing the time zone mode to be specified independently of the date format (see the commit message for [2] and the documentation provided by [3]):

  [0] Light refactoring of date infrastructure
  [1] Pretty Print: show tz when using DATE_LOCAL
  [2] Date Mode: Implementation
  [3] Date Mode: Documentation
  [4] Date Mode: Tests

The date format `local' has thus been deprecated, though it is still supported (with a warning on stderr).

These patches apply cleanly to the current tip of Junio's `next' branch:
  commit 63e4ee5f87eede11d1377370c385c26c5b90c6e7
  Merge: 359ea0b 6ceb270
  Author: Junio C Hamano <gitster@pobox.com>
  Date:   Tue Apr 19 11:51:25 2011 -0700
  
      Merge branch 'master' into next
      
      * master:
        Git 1.7.5-rc3
        Git 1.7.4.5
        git-svn.txt: Document --mergeinfo
  
and it would appear that `make test' runs successfully (including the
extensive testing that I have implemented for date mode features, both
old and new).

There are some whitespace warnings (a la `git diff --check'), but I have reviewed them and personally approve of them; if you think that appraisal is incorrect, then you don't know what you're talking about :-P

Sincerely, Michael Witten

  Documentation/blame-options.txt    |    9 +--
  Documentation/config.txt           |   32 ++++---
  Documentation/date-mode-docs.txt   |   87 +++++++++++++++++++
  Documentation/git-for-each-ref.txt |   19 ++++-
  Documentation/git-log.txt          |   43 ---------
  Documentation/git-rev-list.txt     |    4 +-
  Documentation/git-svn.txt          |    2 +-
  Documentation/rev-list-options.txt |   28 +------
  archive.c                          |    2 +-
  builtin/blame.c                    |   24 +++---
  builtin/cat-file.c                 |    3 +-
  builtin/commit.c                   |    2 +-
  builtin/for-each-ref.c             |   65 ++++++++++----
  builtin/log.c                      |   17 ++--
  builtin/shortlog.c                 |    2 +-
  builtin/show-branch.c              |    3 +-
  cache.h                            |   41 ++++++++-
  commit.h                           |    4 +-
  date.c                             |   84 ++++++++++++++++---
  fast-import.c                      |    4 +-
  http-backend.c                     |    3 +-
  log-tree.c                         |   10 ++-
  pretty.c                           |   18 +++--
  reflog-walk.c                      |    6 +-
  reflog-walk.h                      |    4 +-
  refs.c                             |    6 +-
  revision.c                         |   11 ++-
  revision.h                         |    4 +-
  sha1_name.c                        |    5 +-
  submodule.c                        |    2 +-
  t/date-modes-lib.sh                |  168 ++++++++++++++++++++++++++++++++++++
  t/date-modes-permutator.perl       |   94 ++++++++++++++++++++
  t/t4202-log.sh                     |    3 +
  t/t6300-for-each-ref.sh            |   15 +++-
  t/t8002-blame.sh                   |    9 ++
  test-date.c                        |   11 ++-
  36 files changed, 654 insertions(+), 190 deletions(-)
  create mode 100644 Documentation/date-mode-docs.txt
  create mode 100755 t/date-modes-lib.sh
  create mode 100755 t/date-modes-permutator.perl
-- 
1.7.4.18.g68fe8
Next: Michael Witten
Message 1 of 37 in “[RFC 0/5] Date Mode: Add --time-zone; deprecate --date=local”
  1. Michael WittenApr 20, 2011
  2. 1/5 Light refactoring of date infrastructureMichael Witten, Apr 20, 2011
  3. 2/5 Pretty Print: show tz when using DATE_LOCALMichael Witten, Apr 20, 2011
  4. Junio C HamanoApr 21, 2011
  5. Dates in Commits and other issues of style (Re: [RFC 2/5] Pretty Print: show tz when using DATE_LOCAL)Michael Witten, Apr 22, 2011
  6. Miles BaderApr 25, 2011
  7. Junio C HamanoApr 25, 2011
  8. Jakub NarebskiApr 25, 2011
  9. Junio C HamanoApr 25, 2011
  10. Michael WittenApr 22, 2011
  11. Junio C HamanoApr 22, 2011
  12. 3/5 Date Mode: ImplementationMichael Witten, Apr 20, 2011
  13. Junio C HamanoApr 21, 2011
  14. 4/5 Date Mode: DocumentationMichael Witten, Apr 20, 2011
  15. 5/5 Date Mode: TestsMichael Witten, Apr 20, 2011
  16. Junio C HamanoApr 21, 2011
  17. Michael WittenApr 23, 2011
  18. Michael WittenApr 23, 2011
  19. Time zone option name (Re: [RFC 5/5] Date Mode: Tests)Michael Witten, Apr 23, 2011
  20. Junio C HamanoApr 23, 2011
  21. Michael WittenApr 23, 2011
  22. Jeff KingApr 20, 2011
  23. Michael WittenApr 20, 2011
  24. Junio C HamanoApr 21, 2011
  25. Michael WittenApr 21, 2011
  26. Junio C HamanoApr 21, 2011
  27. Michael WittenApr 21, 2011
  28. Michael WittenApr 20, 2011
  29. Michael WittenApr 20, 2011
  30. Michael WittenApr 20, 2011
  31. Tabs and spaces (Re: [RFC 0/5] Date Mode: Add --time-zone; deprecate --date=local)Jonathan Nieder, Apr 21, 2011
  32. Michael WittenApr 21, 2011
  33. Jonathan NiederApr 21, 2011
  34. Michael WittenApr 21, 2011
  35. Thiago FarinaApr 21, 2011
  36. Alex RiesenApr 21, 2011
  37. Michael WittenApr 21, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.