Re: tracking perms/ownership
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:30
"Josh England" [off-list ref] 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.