Re: confused about preserved permissions

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: confused about preserved permissions

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:30

Benoit SIGOURE [off-list ref] writes:
Someone on IRC pointed me to http://git.or.cz/gitwiki/
ContentLimitations which says:

"By design, git cannot track other aspects of the filesystem, including:
  * File modes (except for the "executable" bit, and being symbolic
link)"

That's weird since the file mode is saved in the tree, isn't there a
way to ask Git to restore this file mode?
The wording you quoted is wrong.  By design, we "chose not to"
track other aspects, even though the underlying data structure
has enough space to use other bit patterns.

We deliberately chose not to use that space, and this default is
very unlikely to change.

In very early days of git, we allowed the work tree modes 0644
vs 0664 propagated back to the index modes and regular file
modes recorded in the tree entries.  This caused unnecessary
pain for poeple merging real projects for no real gain
whatsoever, and the behaviour was fixed to minimally track,
hence we do not track anything but executable bits.

I do not oppose to a new per-project configuration option to
make use of the existing space to record differences vs 0644 vs
0664 vs 0600.  However, I have already seen the downsides, so:

 (1) I am not interested in implementing that myself;

 (2) the places that canonicalize the mode bits obtained from
     the filesystem to 0644 is fairly centralized so it would
     not be too hard to implement (and that is one good reason
     why I do _not_ have to be the person to do so);

 (3) however, (2) means that everybody calls that
     canonicalization logic, and the unintended side effects
     need to be audited for codepaths of all the callers, which
     means a large test suite is probably needed; and

 (4) to me, reviewing such a patch will be much lower priority
     than other patches for the above reasons.

Re: confused about preserved permissions

From: martin f krafft <hidden>
Date: 2016-06-15 22:43:30

also sprach Junio C Hamano [off-list ref] [2007.08.23.0009 +0200]:
We deliberately chose not to use that space, and this default is
very unlikely to change.
The downsides included change in SHA hash on mode change, as far as
I can remember. Anything else?

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
 
"wickedness is a myth
 invented by good people
 to account for the curious attraction of others."
                                                        -- oscar wilde
 
spamtraps: madduck.bogus@madduck.net
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help