From: Erik Warendorph <erik@warendorph.org>
To: Fabrizio Pollastri <f.pollastri@inrim.it>
Cc: git@vger.kernel.org
Subject: Re: preserving mtime
Date: Fri, 16 Nov 2007 13:09:30 +0100 [thread overview]
Message-ID: <20071116120929.GA28144@localhost.localdomain> (raw)
In-Reply-To: <473D63F9.4010201@inrim.it>
* Fabrizio Pollastri <f.pollastri@inrim.it> [2007-11-16 10:33:45 +0100]:
>
> is it possible to tell git to preserve the file modification time in a
> checked out copy? It is useful when managing web files, where mtime is
> tested by spiders for download decisions.
You may find the script "git-set-file-times" in the GitWiki
useful:
ExampleScripts - GitWiki
Setting the timestamps of the files to the commit timestamp
of the commit which last touched them
<http://git.or.cz/gitwiki/ExampleScripts#head-a57deb2b4ab1e2de80ab5fd3c681a6055a9d3247>
You should of course pay attention to advice about (and
against) doing stuff like this, both in the description of that
script and in other postings on this list. But as you are
using Git to manage web files and you (probably) don't care
about build systems such as "make", you should be pretty safe.
About the script: I think it originally was made by Eric Wong
(= normalperson) who is also on this list. I have just made a
tiny, tiny modification to it (adding " or s/\0$//" to the
elsif test).
I've also thought about adding a --prefix option to the script.
This would enable it to be used together with git-archive,
leaving the working directory alone and affecting the files in
the directory where the archive is extracted instead. In this
way, you would distinguish between your working directory and
your "live" directory, and the command sequence
git archive --prefix=foo/ HEAD | (cd /var/www/ && tar xf -)
git-set-file-times --prefix=/var/www/foo/
would be part of the build system, publishing your working
directory to your "live" directory (in this case
/var/www/foo/).
--
Erik Warendorph <erik@warendorph.org>
prev parent reply other threads:[~2007-11-16 12:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-16 9:33 preserving mtime Fabrizio Pollastri
2007-11-16 10:15 ` Andreas Ericsson
2007-11-17 18:22 ` Wayne Davison
2007-11-18 8:45 ` Mike Hommey
2007-11-18 9:34 ` Martin Langhoff
2007-11-18 18:47 ` David Brown
2007-11-18 20:36 ` Martin Langhoff
2007-11-18 21:44 ` David Brown
2007-11-18 9:40 ` Jan Hudec
2007-11-18 10:42 ` Robin Rosenberg
2007-11-19 14:38 ` Johannes Schindelin
2007-11-16 10:19 ` Jakub Narebski
2007-11-16 10:21 ` Junio C Hamano
2007-11-16 12:09 ` Erik Warendorph [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071116120929.GA28144@localhost.localdomain \
--to=erik@warendorph.org \
--cc=f.pollastri@inrim.it \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).