File mode
Matt Mackall
mpm at selenic.com
Sat Sep 9 14:57:56 UTC 2006
On Sat, Sep 09, 2006 at 02:09:07AM -0400, Josef "Jeff" Sipek wrote:
> So, I was thinking about doing some work on symlink support, and while
> digging around the source, I noticed that the flags hack is exactly that - a
> hack (I'm referring to the fact that right now we just append "x" to the
> end of the manifest hash for the executable bit.)
>
> I like what git does better - storing the full mode - including file type
> bits, as well as the three rwx fields. I mentioned it on IRC a few days ago,
> and someone (I forgot who) said that there was some resistance to storing
> the whole mode.
Even git only uses one bit of the mode it stores. With good reason -
there are security concerns. Instead we follow the normal UNIX umask
conventions.
We intentionally store the bare minimum of metadata. In general, it's
not portable/meaningful even from user to user on the same
machine. Consider timestamps - if we restored timestamps, files might
appear to go backwards in time on checkout, causing make to ignore
them. User and group permissions have obvious problems. ACLs, xattrs,
forked and multistreamed files... I'll have nightmares.
> Why? Sure, maybe storing the 3 sets of rwx perms is little too much, but I'd
> say that it would be beneficial to have at least one rwx set, and some kind
> of file type identifier; which brings up the question: what types of files
> do we want to version?
>
> - regular
> - symlinks
> - ...?
That's it. Personally, I'd prefer not to support symlinks because
they're more trouble than they're worth.
If people want to make gross hacks like checking in device nodes or
FIFOs, they can damn well do it with a private filter, hook, or
extension.
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial
mailing list