Re: confused about preserved permissions
- From
Mike Hommey <mh@glandium.org>
- Date
- Aug 20, 2007, 20:50 UTC
- Message-ID
- <20070820205042.GB10173@glandium.org>
- In-Reply-To
- <853ayeos82.fsf@lola.goethe.zz>
On Mon, Aug 20, 2007 at 10:39:57PM +0200, David Kastrup <dak@gnu.org> wrote:
Show 8 quoted lines
> > And it has permissions associated with these hashes. > > No, with the files. Think again: the link between file system and > repository is the index, and the current index format has no > representation for trees or directories. > > So git _can't_ store any information about a _directory_, since no > information about directories passes through the index.
If, as Jan suggested in a previous message, you introduce directories in the index, I still don't see why you would need two entries in the tree object...
Show 12 quoted lines
> > (...)
> >> > I think i wasn't clear enough... I just wondered why the format for tree
> >> > entries is something like (if you'd write it in perl):
> >> > sprintf "%06o %s\0%s", $mode, $file, pack("H[40]", $sha1)
> >>
> >> Now I am sure I don't get your point.
> >
> > See what a raw tree object looks like:
> > git-cat-file tree 708453d64796eb617cb8a1602959e00356693315
>
> Well, a tree is a container for files (which in turn consist of their
> permissions, file names, and blobs).The question here was why the permissions are encoded with "%06o" while the hash is packed. Anyways, it's just a boring detail.
Mike