Subject: Re: tracking perms/ownership

From: Junio C Hamano <[email-masked]>
Date: Thu, 23 Aug 2007 15:08:25 -0700

"Josh England" <[email-masked]> writes:

> Looking at the index struct, it already has fields in it for file mode
> uid and gid (woohoo!).

I can see that storing textual names in gitattributes and having
the root user run git so that it can chown(), would work.

But this is only about checkout.  After you chown a file in the
work tree and run update-index, next write-tree would not record
it, as there is no place in tree objects to record uid/gid.
You would need to arrange so that a matching change is made in
the gitattributes file if you go that route.

If you had:

	etc/*		owner=root
        etc/frotz	owner=nobody

in gitattributes, and you did a checkout.  You chown etc/nitfol
with "chown printer etc/nitfol".  Somebody needs to add a line

	etc/nitfol	owner=printer

to gitattributes before you make the commit.  Maybe the chown
was not about etc/nitfol but about making etc/frotz owned by
root.  Then you would, instead of adding the etc/nitfol line,
remove existing etc/frotz line so that earlier glob would
capture and express the idea of making everything owned by
root.  I suspect this would get rather tricky quickly.

Of course, you would need to worry about resolving merge
conflicts of gitattributes file, too.