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

Re: Passing tar(1) options via git-archive(1)

From
Thomas Braun <thomas.braun@virtuell-zuhause.de>
Date
Sep 23, 2014, 21:49 UTC
Message-ID
<5421EAE4.30704@virtuell-zuhause.de>
In-Reply-To
<87bnq6jhbk.fsf@brockman.se>
Am 23.09.2014 um 20:57 schrieb Daniel Brockman:
Show 19 quoted lines
> Some background from the git-archive(1) man page:
> 
>     git-archive behaves differently when given a tree ID versus when
>     given a commit ID or tag ID.  In the first case the current time is
>     used as the modification time of each file in the archive.  In the
>     latter case the commit time as recorded in the referenced commit
>     object is used instead.
> 
> Would it make sense to add an --mtime option to git-archive(1) to enable
> explicitly setting the mtime for all files in the archive?  It could
> just pass through to the tar(1) --mtime option.
> 
> My use case is `git archive HEAD | docker build -`, in which the Docker
> cache is prevented from working because the mtime keeps getting bumped
> on all files.  I would like to have the mtime always be the same.
> 
> See, e.g., <https://github.com/deis/deis/issues/1334>.
> 
> Otherwise, how about a generic way to pass options to tar(1)?

Actually I wanted to just hint to TAR_OPTIONS as in TAR_OPTIONS="--mtime 2014-09-23\ 00:00" git archive -o ausg.tar HEAD but that does not work here (on windows).

The questions is should it be supported?
Previous: Daniel BrockmanNext: brian m. carlson
Message 2 of 5 in “Passing tar(1) options via git-archive(1)”
  1. Daniel BrockmanSep 23, 2014
  2. Thomas BraunSep 23, 2014
  3. brian m. carlsonSep 24, 2014
  4. Daniel BrockmanSep 24, 2014
  5. Jeff KingSep 24, 2014

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.