git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: tracking perms/ownership

From
JEJosh England <jjengla@sandia.gov>
Date
Aug 24, 2007, 07:38 UTC
Message-ID
<1187941133.6357.75.camel@beauty>
In-Reply-To
<alpine.LFD.0.999.0708232327100.25853@woody.linux-foundation.org>
On Thu, 2007-08-23 at 23:37 -0700, Linus Torvalds wrote:
Show 30 quoted lines
> 
> On Fri, 24 Aug 2007, David Kastrup wrote:
> > >
> > > So handling ownership outside of the actual filesystem, in a
> > > separate file that git tracks, actually allows you to do things that
> > > you couldn't otherwise sanely do.
> > 
> > Well, about that "sane" bit: I don't see an application for tracking
> > unrestorable ownership values.
> 
> Umm. Like an RPM spec file?
> 
> The thing you "don't see an application" for is exactly the kind of things 
> that people very much ALREADY DO. 
> 
> There are tons of different setups for setting up user and group ownership 
> (and things like permission) in almost any project. And I can pretty much 
> *guarantee* you that none of them depend on actually having ownership on 
> the files themselves.
> 
> In git, just for fun, do
> 
> 	git grep defattr
> 
> or even just look into the Makefile, and think about what lines like that
> 
> 	$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(bindir_SQ)'
> 
> thing means, and why it has a "755" there, and why other Makefiles quite 
> often have things like "-o bin" etc on such lines!

Yes. Permission bits are useful. I wouldn't want a umask clobbering some /bin directory to 0644 or some such.

> See? Those ownership things are restorable *as*root*, but that doesn't 
> mean that everybody should do development as root. In fact, I'd argue
>  that any system that is set up so that you have to develop and merge
>  things while being root is pretty damn broken.

If your repository is a full system image (my extreme case), developing as root (installing packages, altering configs) is *required* if you expect the image to boot/behave properly. Squashing ownership in this case would undoubtedly break many things.

Show 6 quoted lines
> Which means that any such environment *has* to encode the owndership 
> *separately* from the actual filesystem ownership. Because doing it in the 
> filesystem simply isn't sane.
> 
> So yes, you could have an insane piece of crap that actually tracks file 
> ownership in the filesystem, and requires people to be root.

This is what I've done with SVN. The mechanisms to save/restore perms/ownership can be run as hooks before checkin and after checkout. The performance is pretty depressing even without running those hooks every time. I'm just hoping that using .gitattribues will perform reasonably well.

> Or you could use a ".gitattributes" file or similar _external_ tracking 
> method that allows even people who cannot actually set ownership to work 
> with it.

Yes, although it would be nice if a clone or a pull tells me (running as a user) that the ownership being set doesn't match the uid/gid in the attribute file. Element of least surprise. For those actually requesting the behavior, a little extra verbosity seems pretty acceptable.

-JE
Previous: Linus TorvaldsNext: David Kastrup
Message 12 of 41 in “empty directories”
  1. Josh EnglandAug 21, 2007
  2. SeanAug 21, 2007
  3. Josh EnglandAug 22, 2007
  4. Linus TorvaldsAug 22, 2007
  5. David KastrupAug 22, 2007
  6. Josh EnglandAug 23, 2007
  7. tracking perms/ownership [was: empty directories]Josh England, Aug 23, 2007
  8. Junio C HamanoAug 23, 2007
  9. Linus TorvaldsAug 23, 2007
  10. David KastrupAug 24, 2007
  11. Linus TorvaldsAug 24, 2007
  12. Josh EnglandAug 24, 2007
  13. David KastrupAug 24, 2007
  14. Linus TorvaldsAug 24, 2007
  15. Josh EnglandAug 24, 2007
  16. Linus TorvaldsAug 24, 2007
  17. Josh EnglandAug 24, 2007
  18. Junio C HamanoAug 24, 2007
  19. Josh EnglandAug 24, 2007
  20. Robin RosenbergAug 24, 2007
  21. David KastrupAug 24, 2007
  22. Josh EnglandAug 24, 2007
  23. Junio C HamanoAug 24, 2007
  24. Josh EnglandAug 24, 2007
  25. Josh EnglandAug 24, 2007
  26. Josh EnglandAug 24, 2007
  27. Johannes SchindelinAug 24, 2007
  28. Jeff KingAug 24, 2007
  29. Josh EnglandAug 24, 2007
  30. Jeff KingAug 24, 2007
  31. Johannes SchindelinAug 25, 2007
  32. Junio C HamanoAug 25, 2007
  33. Junio C HamanoAug 25, 2007
  34. Jeff KingAug 24, 2007
  35. Johannes SchindelinAug 25, 2007
  36. Jason GarberAug 24, 2007
  37. Jakub NarebskiAug 22, 2007
  38. Jakub NarebskiAug 22, 2007
  39. Salikh ZakirovAug 22, 2007
  40. Linus TorvaldsAug 22, 2007
  41. David KastrupAug 22, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.