* Reverting/cheout files with old modification date
@ 2011-06-09 7:09 Peter Pientka
2011-06-10 7:17 ` Fabrizio Chiarello
0 siblings, 1 reply; 2+ messages in thread
From: Peter Pientka @ 2011-06-09 7:09 UTC (permalink / raw)
To: git
Hi,
Is any way to revert/checkout some files from reposotory with old modification
date(file parameter). Now, while I revert/checkout some file, modification date
of file is set to current date and time.
Currently I`m using git version 1.7.4.msysgit.0
Thanks for reply
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Reverting/cheout files with old modification date
2011-06-09 7:09 Reverting/cheout files with old modification date Peter Pientka
@ 2011-06-10 7:17 ` Fabrizio Chiarello
0 siblings, 0 replies; 2+ messages in thread
From: Fabrizio Chiarello @ 2011-06-10 7:17 UTC (permalink / raw)
To: Peter Pientka; +Cc: git
On Thu, Jun 09, 2011 at 07:09:47AM +0000, Peter Pientka wrote:
> Hi,
> Is any way to revert/checkout some files from reposotory with old modification
> date(file parameter). Now, while I revert/checkout some file, modification date
> of file is set to current date and time.
>
I use this hook. On checkout it sets the mtime of all the files to
the date of the last commit touching them.
===== .git/hooks/post-checkout
#!/bin/sh
for f in `git ls-tree --name-only -r HEAD`; do
mtime=`git log -n1 --date=iso --pretty=%ai -- $f`
touch -m -d "$mtime" $f
done
=====
--
Fabrizio Chiarello <fabrizio.chiarello@ieee.org>
You ask: what is the meaning or purpose of life? I can only answer with
another question: do you think we are wise enough to read God's mind?
-- Freeman Dyson
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-10 7:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-09 7:09 Reverting/cheout files with old modification date Peter Pientka
2011-06-10 7:17 ` Fabrizio Chiarello
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).