Re: Preserving timestamps with git

2010-05-28 Thread Jakob Voss

Olaf TNSB wrote:


Can you explain (or give a simple example) why you need the timestamps
to be correct.


 After moving to a versioned homedir (and getting my mind around what
 that means) I've never worried about the revision time of my files. I
 just knew they were either the most recent version or a particular
 version for a particular reason.

In my homedir I have a mypub directory/repository with lots of 
publications (presentations, articles, drafts etc.) that I created and 
partly published over the years[*]. I frequently look up old drafts and 
publications and sometimes I continue working on a text after month or 
years. Therefore I'd like to track when I created and modified which 
document.


 I can understand the need for other metadata (file perms for .ssh for
 example) but not file date. Perhaps I'm missing something huge that
 will make my life easier...

As I only track my own files I do not need to preserve ownership and the 
default permission should be 027 (u=rwx,g=rx,o=) for all my files. There 
is only a problem with files that should be readable by anyone (or the 
other way you make all files publicly readable and must treat the 
private files in a special way). Versioning public_html is also a 
problem because files must be readable by www-data (and some also 
writable) - is this where you use metastore for?


Cheers,
Jakob

[*] Maybe I will later create a branch with the public subset of this 
files. At this place file permissions would also help: a cronjob could 
look for files with permission o+r and push these into a public 
repository. And the other way: a cronjob checks for files which are both 
in a private repository and its public branch and sets permission o+r 
on those.

___
vcs-home mailing list
vcs-home@lists.madduck.net
http://lists.madduck.net/listinfo/vcs-home


Re: Preserving timestamps with git

2010-05-27 Thread Olaf TNSB
Hi Jakob,

Can you explain (or give a simple example) why you need the timestamps
to be correct.

After moving to a versioned homedir (and getting my mind around what
that means) I've never worried about the revision time of my files. I
just knew they were either the most recent version or a particular
version for a particular reason.

I can understand the need for other metadata (file perms for .ssh for
example) but not file date. Perhaps I'm missing something huge that
will make my life easier...

Cheers,
Olaf

On 5/27/10, Jakob Voss jakob.v...@gbv.de wrote:
 Hi,

 I started to move the content of my home directory to git repositories
 and stumbled upon a difficult difference between rsync and git: git does
 not preserve timestamps. This makes sense for code-repositories but if I
 replicate my home directory I expect that modification times are not
 always set to the current time.

 I found this useful script (which I called 'git-utime') to set
 modifcation times to the timestamp of the commit which last touched a
 file. As far as I understand this is the best we have because git does
 not store the original timestamp when a file is commited (right?):

 https://git.wiki.kernel.org/index.php/ExampleScripts#Setting_the_timestamps_of_the_files_to_the_commit_timestamp_of_the_commit_which_last_touched_them

 I bet there is some hook to install the script to be called on every
 pull - I think of a .gitutime file like .gitignore that selects all
 files that should get their original timestamp. If some of you already
 have such a system please let me know!

 But git-utime is only one side of the process. How do I

 1) reset the commit time of selected files in the repository to their
 last modification timestamp (for the files that I have already commited)

 2) add and commit a set of files in a batch such that each commit has
 the timestamp of the last modification time of its file (for new files).

 Obviously each commit must be only one file. The commit message could
 just be initial commit or initial commit at `date --rfc-3339=s`.

 Maybe by some additional git magic the .gitutime could be reused to give
 a warning if I try to add a new file that the normal way which would
 makes it impossible to preserve timestamp.


 How do you deal with timestamp of you files? I heard there are some
 hacks to even preserve file permissions but I'd prefer a simple solution
 first.

 Cheers,
 Jakob

 --
 Jakob Voß jakob.v...@gbv.de, skype: nichtich
 Verbundzentrale des GBV (VZG) / Common Library Network
 Platz der Goettinger Sieben 1, 37073 Göttingen, Germany
 +49 (0)551 39-10242, http://www.gbv.de
 ___
 vcs-home mailing list
 vcs-home@lists.madduck.net
 http://lists.madduck.net/listinfo/vcs-home


-- 
Sent from my mobile device
___
vcs-home mailing list
vcs-home@lists.madduck.net
http://lists.madduck.net/listinfo/vcs-home