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

Re: git and symlinks as tracked content

From
Junio C Hamano <junkio@cox.net>
Date
May 3, 2005, 23:42 UTC
Message-ID
<7vhdhjswp3.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<427806CA.6030302@zytor.com>
>>>>> "HPA" == H Peter Anvin <hpa@zytor.com> writes:
HPA> Junio C Hamano wrote:

HPA> Owner and permissions are part of the tree object, and apply to HPA> all file types.

>> Huh?  I am confused...  Do you mean tree object should be
>> changed to record these?  That would make the existing in-cache
>> merging of files, which GIT was built for, quite interesting...
HPA> No, the tree object *ALREADY* records these.

As you quoted (and before I uttered my previous confusion I did look at the code in write-tree.c which I thought to match this description) ...

HPA> TREE: The next hierarchical object type is the "tree" object. A tree HPA> object is a list of permission/name/blob data, sorted by name. In other HPA> words the tree object is uniquely determined by the set contents, and so HPA> two separate but identical trees will always share the exact same HPA> object.

... it records permission (but not in the 0660 vs 0600 sense --- it just records executable bit for file blobs and the treeness by recording S_IFDIR), name and SHA1. There is no owner or group information recorded there [*1*].

I am afraid I am missing something in my reading of write-tree.c
Quite confused...
[Footnote]

*1* Nor there should be. Otherwise comparing two identical trees representing the same set of files become meaningless.

The reason why I placed these information in my hypothetical representation of device nodes is exactly that. To record owner and group information is meaningless and harmful for the purpose of version controlling the source files but it matters _if_ we wanted to maintain device nodes in GIT. Since it matters only for those things, it would be preferable to have it as part of the data that describes the object (i.e. device nodes), not part of the data that contains the object (i.e. tree). And I thought GIT tree object is already doing the right thing by not recording them.

Previous: Linus TorvaldsNext: David A. Wheeler
Message 16 of 29 in “git and symlinks as tracked content”
  1. Kay SieversMay 3, 2005
  2. Linus TorvaldsMay 3, 2005
  3. Morten WelinderMay 3, 2005
  4. H. Peter AnvinMay 3, 2005
  5. Andreas GalMay 3, 2005
  6. Linus TorvaldsMay 3, 2005
  7. Kay SieversMay 3, 2005
  8. Junio C HamanoMay 3, 2005
  9. Andreas GalMay 3, 2005
  10. Junio C HamanoMay 3, 2005
  11. Sym-links, b/c-special files, pipes, ... Scope CreepBrian O'Mahoney, May 4, 2005
  12. H. Peter AnvinMay 3, 2005
  13. Junio C HamanoMay 3, 2005
  14. H. Peter AnvinMay 3, 2005
  15. Linus TorvaldsMay 3, 2005
  16. Junio C HamanoMay 3, 2005
  17. David A. WheelerMay 4, 2005
  18. Daniel BarkalowMay 4, 2005
  19. Alan ChandlerMay 5, 2005
  20. read-only git repositoriesDavid Lang, May 5, 2005
  21. SeanMay 5, 2005
  22. David A. WheelerMay 6, 2005
  23. Daniel BarkalowMay 5, 2005
  24. Junio C HamanoMay 3, 2005
  25. Kay SieversMay 4, 2005
  26. Junio C HamanoMay 4, 2005
  27. Kay SieversMay 5, 2005
  28. Junio C HamanoMay 5, 2005
  29. Kay SieversMay 5, 2005

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.