Re: git and symlinks as tracked content
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:41:56
quoted
quoted
quoted
quoted
"HPA" == H Peter Anvin [off-list ref] writes:
HPA> Junio C Hamano wrote: HPA> Owner and permissions are part of the tree object, and apply to HPA> all file types.
quoted
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.