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

Re: tracking perms/ownership

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 24, 2007, 20:37 UTC
Message-ID
<7vfy28d5yl.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1187981803.6357.173.camel@beauty>
"Josh England" <jjengla@sandia.gov> writes:
> But the stat data (even uid/gid) is in there nonetheless, right?  If
> everything is in there already I wouldn't need to add a thing.  I just
> want to access the index cache rather than hitting the filesystem
> directly.

But to use that data you would need extra code to move things from there to gitattributes, wouldn't you? I can see that you could "stage" change of ownership in the index and attempt to commit by nonexisting

	git update-index --chown root foo.c

which would say "foo.c is now owned by uid #0", but before the next git-commit-tree runs, somebody (namely, "git-commit") has to run a possibly enhanced "git diff-files" (traditionally uid/gid are NOT part of contents at all, so diff-files would not say ownership has changed between the filesystem and index in what way at all) to notice that ownership has changed, and update .gitattributes.

Then you need to also "git update-index" the .gitattributes as well, to record the ownership change in the commit. What if the user had unrelated changes that the user does not want to commit in .gitattributes?

It will quickly become a mess.

It would rather be more effective for the user action "I want to change the ownership of foo.c to root" to cause a direct manipulation of .gitattributes file. For this, we can add a nice wrapper if there is a need, but the initial cut could be just running "${EDITOR-${VISUAL-vi}} .gitattributes", nothing more.

The user can say "git diff" to view .gitattributes changes, and if that is what he wants (maybe he wants to do "git add -i" to pick only the hunk about the ownership change for the next commit), the change to .gitattributes can be committed.

Previous: Josh EnglandNext: Josh England
Message 18 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.