Re: Using GIT to store /etc (Or: How to make GIT store all file permission bits)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andy Parkins
Date: Tuesday, December 12, 2006 - 8:53 am

On Tuesday 2006 December 12 13:49, Kyle Moffett wrote:


I wonder if git's skill at managing content is the answer?  Rather than mess 
around with git's internals, the index, or the object database; how about 
simply having a pre-commit script that writes out a file that looks like:

-rw-r--r--  andyp andyp CHANGES
-rw-r--r--  andyp andyp COPYING
-rw-rw-r--  andyp andyp CREDITS
-rw-r--r--  andyp andyp Configure
-rw-rw-r--  andyp andyp Makefile
-rw-r--r--  andyp andyp README

If /that/ file were stored in the repository and you had a script that could 
read that file and apply the permissions after a checkout you'd have what you 
want.

If the permissions of a file changed but the content didn't, then 
this ".gitpermissions" file would have changed content but the file itself 
would remain the same.  If the content changed but not the permissions 
then ".gitpermissions" would be untouched.

Assuming that you're allowed to mess with the index in pre-commit (I haven't 
checked), one half of it can be automatic.  I suppose you could also plead 
for a post-checkout hook to apply those permissions and the whole lot would 
be transparent.



Andy
-- 
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@gmail.com
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: Using GIT to store /etc (Or: How to make GIT store all ..., Andy Parkins, (Tue Dec 12, 8:53 am)
Re: Using git as a general backup mechanism (was Re: Using ..., Johannes Schindelin, (Tue Dec 12, 3:57 pm)
Re: Using git as a general backup mechanism, Junio C Hamano, (Tue Dec 12, 4:43 pm)
Re: Using git as a general backup mechanism (was Re: Using ..., Johannes Schindelin, (Tue Dec 12, 5:01 pm)
Re: Using git as a general backup mechanism, Steven Grimm, (Thu Dec 14, 4:33 pm)
Re: Using git as a general backup mechanism, Junio C Hamano, (Thu Dec 14, 5:33 pm)