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

Re: Feature request: Add --mtime option to git archive

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Feb 18, 2023, 17:08 UTC
Message-ID
<Y/EFfxe0GGqnipvL@tapette.crustytoothpaste.net>
In-Reply-To
<CANgJU+VaF7-SJgGPqYGEV5VcJd_nTt2SMOQ5u9mNZ_wsArKT6g@mail.gmail.com>
On 2023-02-18 at 03:04:12, demerphq wrote:
Show 10 quoted lines
> I could understand this position if letting the user set the --mtime
> implied some harm that must be mitigated, but it seems like an odd
> choice if there is none.  Especially given it would also future proof
> git against people coming up with a good reason not to use the 0 epoch
> in the future that you haven't thought of right now. It is not like
> epoch's and unix time have a totally uncontroversial and stable
> history. 0 has meant multiple dates over time, and the current
> definition of 1 Jan 1970, 00:00:00 UTC is problematic as UTC didn't
> exist until 1972!  Given it clearly wouldn't be hard to allow users to
> select the epoch in these archives then why not do so?

If folks want such an option, they're welcome to send a patch to do that. My approach is providing a stable tar format that doesn't change, and for people who want to use that format, it has fixed timestamps for trees (so it's completely rigid). If people want to use the default format with an arbitrary timestamp, that's fine, and we can support that, but we won't guarantee that that format won't change its serialization in the future.

Show 7 quoted lines
> I have seen devs have issues with stuff like this in the past.
> Unpacking an archive on one machine showing a different date than one
> another, or other weird artifacts. Mac used to use a different 0 epoch
> than windows and linux as I recall, etc etc.  I dont remember the gory
> details, but i have definitely seen people gnash their teeth over
> these kind of decisions before. Why not side-step that if you can and
> let people choose their own defaults?

The ustar format is defined by POSIX and uses the Unix epoch, just like the zip format has its own epoch. If you're processing a tar archive, you need to use the Unix epoch.

-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
Previous: demerphqNext: René Scharfe
Message 10 of 16 in “Feature request: Add --mtime option to git archive”
  1. Raul E RangelFeb 16, 2023
  2. Jeff KingFeb 16, 2023
  3. Junio C HamanoFeb 16, 2023
  4. Jeff KingFeb 17, 2023
  5. Junio C HamanoFeb 17, 2023
  6. Raul RangelFeb 17, 2023
  7. René ScharfeFeb 17, 2023
  8. Jeff KingFeb 17, 2023
  9. demerphqFeb 18, 2023
  10. brian m. carlsonFeb 18, 2023
  11. archive: add --mtimeRené Scharfe, Feb 18, 2023
  12. Junio C HamanoFeb 18, 2023
  13. René ScharfeFeb 19, 2023
  14. Junio C HamanoFeb 21, 2023
  15. Jeff KingFeb 22, 2023
  16. Junio C HamanoFeb 22, 2023

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.