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

standarize mtime when git checkout

From
RLRick Liu <rickliu@broadcom.com>
Date
Jul 8, 2013, 21:39 UTC
Message-ID
<7D0754FFADBD2D4785C1D233C497C47B209AF2BC@SJEXCHMB06.corp.ad.broadcom.com>
Hi,

Currently when doing "git checkout" (either for a branch or a tag), if the file doesn't exist before, the file will be created using current datetime.

This causes problem while trying to tar the git repository source files (excluding .git folder). The tar binary can be different even all of file contents are the same (eg. from the same GIT commit) because the mtime for the files might be different due to different "git checkout" time.

eg: User A checkout the commit at time A and then tarball the folder. User B checkout the same commit as time B and then tarball the folder. The result tarball are binary different even though all of tarball contents are the same except the mtime for each file.

Can we use GIT's commit time as the mtime for all of files/folders when we do "git checkout"?
Rick
Next: Junio C Hamano
Message 1 of 4 in “standarize mtime when git checkout”
  1. Rick LiuJul 8, 2013
  2. Junio C HamanoJul 8, 2013
  3. René ScharfeJul 9, 2013
  4. Rick LiuJul 9, 2013

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.