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

Re: [PATCH 0/6] Use time_t

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 28, 2017, 17:26 UTC
Message-ID
<xmqqvarukz0g.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170228142802.hu5esthnqdsgc2po@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 9 quoted lines
> I do not just agree, but I think the move to a signed timestamp is a big
> improvement. Git's object format is happy to represent times before
> 1970, but the code is not. I know this has been a pain for people who
> import ancient histories into Git.
>
> It looks from the discussion like the sanest path forward is our own
> signed-64bit timestamp_t. That's unfortunate compared to using the
> standard time_t, but hopefully it would reduce the number of knobs (like
> TIME_T_IS_INT64) in the long run.

Keeping it unsigned is safer in the short-term. There are some places that uses 0 as "impossible time" (e.g. somebody tried to parse a string as time and returns a failure) and these places need to be found and be replaced with probably the most negative value that timestamp_t cn represent. Another possible special value we may use is for "expiring everything" but I think we tend to just use the timestamp of the present time for that purpose and not UONG_MAX, so we should be OK there.

But we need to cross the bridge to signed timestamp sometime, and I do not see any reason why that somtime should not be now.

Previous: René ScharfeNext: Jeff King
Message 26 of 113 in “Use time_t”
  1. 0/6 Use time_tJohannes Schindelin, Feb 27, 2017
  2. 5/6 ref-filter: avoid using `unsigned long` for catch-all data typeJohannes Schindelin, Feb 27, 2017
  3. 4/6 Prepare for timestamps to use 64-bit signed typesJohannes Schindelin, Feb 27, 2017
  4. 3/6 Introduce a new "printf format" for timestampsJohannes Schindelin, Feb 27, 2017
  5. Junio C HamanoMar 1, 2017
  6. Junio C HamanoMar 1, 2017
  7. 2/6 Specify explicitly where we parse timestampsJohannes Schindelin, Feb 27, 2017
  8. Junio C HamanoFeb 27, 2017
  9. Junio C HamanoFeb 27, 2017
  10. Johannes SchindelinFeb 28, 2017
  11. 1/6 t0006 & t5000: prepare for 64-bit time_tJohannes Schindelin, Feb 27, 2017
  12. Junio C HamanoFeb 27, 2017
  13. 6/6 Use time_t where appropriateJohannes Schindelin, Feb 27, 2017
  14. Junio C HamanoFeb 27, 2017
  15. Johannes SchindelinFeb 28, 2017
  16. Jeff KingFeb 28, 2017
  17. Johannes SchindelinFeb 28, 2017
  18. René ScharfeFeb 28, 2017
  19. Junio C HamanoFeb 28, 2017
  20. Jeff KingFeb 28, 2017
  21. Johannes SchindelinFeb 28, 2017
  22. Jeff KingFeb 28, 2017
  23. René ScharfeFeb 28, 2017
  24. Johannes SchindelinFeb 28, 2017
  25. René ScharfeMar 1, 2017
  26. Junio C HamanoFeb 28, 2017
  27. Jeff KingFeb 28, 2017
  28. Junio C HamanoFeb 28, 2017
  29. Jeff KingFeb 28, 2017
  30. Junio C HamanoMar 1, 2017
  31. 0/8 Introduce timestamp_t for timestampsJohannes Schindelin, Apr 2, 2017
  32. 1/8 ref-filter: avoid using `unsigned long` for catch-all data typeJohannes Schindelin, Apr 2, 2017
  33. Torsten BögershausenApr 3, 2017
  34. Johannes SchindelinApr 3, 2017
  35. 2/8 t0006 & t5000: prepare for 64-bit timestampsJohannes Schindelin, Apr 2, 2017
  36. 3/8 t0006 & t5000: skip "far in the future" test when time_t is too limitedJohannes Schindelin, Apr 2, 2017
  37. 4/8 Specify explicitly where we parse timestampsJohannes Schindelin, Apr 2, 2017
  38. Torsten BögershausenApr 3, 2017
  39. Johannes SchindelinApr 3, 2017
  40. 5/8 Introduce a new "printf format" for timestampsJohannes Schindelin, Apr 2, 2017
  41. 6/8 Introduce a new data type for timestampsJohannes Schindelin, Apr 2, 2017
  42. 7/8 Abort if the system time cannot handle one of our timestampsJohannes Schindelin, Apr 2, 2017
  43. 8/8 Use uintmax_t for timestampsJohannes Schindelin, Apr 2, 2017
  44. 0/8 Introduce timestamp_t for timestampsJohannes Schindelin, Apr 20, 2017
  45. 1/8 ref-filter: avoid using `unsigned long` for catch-all data typeJohannes Schindelin, Apr 20, 2017
  46. 2/8 t0006 & t5000: prepare for 64-bit timestampsJohannes Schindelin, Apr 20, 2017
  47. 3/8 t0006 & t5000: skip "far in the future" test when time_t is too limitedJohannes Schindelin, Apr 20, 2017
  48. 4/8 Specify explicitly where we parse timestampsJohannes Schindelin, Apr 20, 2017
  49. 5/8 Introduce a new "printf format" for timestampsJohannes Schindelin, Apr 20, 2017
  50. 6/8 Introduce a new data type for timestampsJohannes Schindelin, Apr 20, 2017
  51. 8/8 Use uintmax_t for timestampsJohannes Schindelin, Apr 20, 2017
  52. 7/8 Abort if the system time cannot handle one of our timestampsJohannes Schindelin, Apr 20, 2017
  53. Junio C HamanoApr 21, 2017
  54. Johannes SchindelinApr 21, 2017
  55. 0/9 Introduce timestamp_t for timestampsJohannes Schindelin, Apr 21, 2017
  56. 1/9 ref-filter: avoid using `unsigned long` for catch-all data typeJohannes Schindelin, Apr 21, 2017
  57. 2/9 t0006 & t5000: prepare for 64-bit timestampsJohannes Schindelin, Apr 21, 2017
  58. 3/9 t0006 & t5000: skip "far in the future" test when time_t is too limitedJohannes Schindelin, Apr 21, 2017
  59. 4/9 Specify explicitly where we parse timestampsJohannes Schindelin, Apr 21, 2017
  60. Junio C HamanoApr 24, 2017
  61. 5/9 Introduce a new "printf format" for timestampsJohannes Schindelin, Apr 21, 2017
  62. 6/9 Introduce a new data type for timestampsJohannes Schindelin, Apr 21, 2017
  63. 7/9 Abort if the system time cannot handle one of our timestampsJohannes Schindelin, Apr 21, 2017
  64. Junio C HamanoApr 24, 2017
  65. Johannes SchindelinApr 24, 2017
  66. Junio C HamanoApr 25, 2017
  67. Junio C HamanoApr 25, 2017
  68. 8/9 Use uintmax_t for timestampsJohannes Schindelin, Apr 21, 2017
  69. Junio C HamanoApr 24, 2017
  70. Johannes SchindelinApr 24, 2017
  71. Junio C HamanoApr 25, 2017
  72. Johannes SchindelinApr 25, 2017
  73. Junio C HamanoApr 26, 2017
  74. Junio C HamanoApr 26, 2017
  75. Johannes SchindelinApr 26, 2017
  76. Junio C HamanoApr 26, 2017
  77. 9/9 show_date_ident(): defer date overflow checkJohannes Schindelin, Apr 21, 2017
  78. Junio C HamanoApr 24, 2017
  79. Jacob KellerApr 24, 2017
  80. Johannes SchindelinApr 24, 2017
  81. Jeff KingApr 24, 2017
  82. Johannes SchindelinApr 25, 2017
  83. Johannes SchindelinApr 24, 2017
  84. 0/8 Introduce timestamp_t for timestampsJohannes Schindelin, Apr 24, 2017
  85. 1/8 ref-filter: avoid using `unsigned long` for catch-all data typeJohannes Schindelin, Apr 24, 2017
  86. 2/8 t0006 & t5000: prepare for 64-bit timestampsJohannes Schindelin, Apr 24, 2017
  87. 3/8 t0006 & t5000: skip "far in the future" test when time_t is too limitedJohannes Schindelin, Apr 24, 2017
  88. 5/8 Introduce a new "printf format" for timestampsJohannes Schindelin, Apr 24, 2017
  89. 4/8 Specify explicitly where we parse timestampsJohannes Schindelin, Apr 24, 2017
  90. Junio C HamanoApr 25, 2017
  91. 6/8 Introduce a new data type for timestampsJohannes Schindelin, Apr 24, 2017
  92. Johannes SixtApr 26, 2017
  93. Johannes SchindelinApr 26, 2017
  94. René ScharfeApr 26, 2017
  95. 7/8 Abort if the system time cannot handle one of our timestampsJohannes Schindelin, Apr 24, 2017
  96. 8/8 Use uintmax_t for timestampsJohannes Schindelin, Apr 24, 2017
  97. Johannes SixtApr 26, 2017
  98. Johannes SchindelinApr 26, 2017
  99. René ScharfeApr 25, 2017
  100. Johannes SchindelinApr 25, 2017
  101. René ScharfeApr 26, 2017
  102. Junio C HamanoApr 26, 2017
  103. 0/8 Introduce timestamp_t for timestampsJohannes Schindelin, Apr 26, 2017
  104. 1/8 ref-filter: avoid using `unsigned long` for catch-all data typeJohannes Schindelin, Apr 26, 2017
  105. 2/8 t0006 & t5000: prepare for 64-bit timestampsJohannes Schindelin, Apr 26, 2017
  106. 3/8 t0006 & t5000: skip "far in the future" test when time_t is too limitedJohannes Schindelin, Apr 26, 2017
  107. 4/8 Specify explicitly where we parse timestampsJohannes Schindelin, Apr 26, 2017
  108. 5/8 Introduce a new "printf format" for timestampsJohannes Schindelin, Apr 26, 2017
  109. 6/8 Introduce a new data type for timestampsJohannes Schindelin, Apr 26, 2017
  110. name-rev: change a "long" variable to timestamp_tJunio C Hamano, May 20, 2017
  111. Johannes SchindelinMay 22, 2017
  112. 7/8 Abort if the system time cannot handle one of our timestampsJohannes Schindelin, Apr 26, 2017
  113. 8/8 Use uintmax_t for timestampsJohannes Schindelin, Apr 26, 2017

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.