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

Re: confused about preserved permissions

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 22, 2007, 22:09 UTC
Message-ID
<7v8x83i5ma.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<6031FB22-648E-47DE-92EE-2E7255322C27@lrde.epita.fr>
Benoit SIGOURE <tsuna@lrde.epita.fr> writes:
Show 9 quoted lines
> 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.
Previous: Johannes SixtNext: martin f krafft
Message 15 of 39 in “confused about preserved permissions”
  1. martin f krafftAug 20, 2007
  2. Pierre HabouzitAug 20, 2007
  3. martin f krafftAug 20, 2007
  4. Mike HommeyAug 20, 2007
  5. David KastrupAug 20, 2007
  6. Mike HommeyAug 20, 2007
  7. David KastrupAug 20, 2007
  8. René ScharfeAug 21, 2007
  9. Documentation: update tar.umask defaultRené Scharfe, Aug 21, 2007
  10. Mike HommeyAug 21, 2007
  11. René ScharfeAug 22, 2007
  12. Alex RiesenAug 20, 2007
  13. Benoit SIGOUREAug 22, 2007
  14. Johannes SixtAug 22, 2007
  15. Junio C HamanoAug 22, 2007
  16. martin f krafftAug 23, 2007
  17. David KastrupAug 23, 2007
  18. martin f krafftAug 23, 2007
  19. Benoit SIGOUREAug 23, 2007
  20. Junio C HamanoAug 23, 2007
  21. David KastrupAug 23, 2007
  22. Jan HudecSep 3, 2007
  23. Junio C HamanoAug 23, 2007
  24. Mike HommeyAug 20, 2007
  25. Jan HudecAug 20, 2007
  26. Mike HommeyAug 20, 2007
  27. Alex RiesenAug 20, 2007
  28. Mike HommeyAug 20, 2007
  29. Jan HudecAug 20, 2007
  30. David KastrupAug 20, 2007
  31. Mike HommeyAug 20, 2007
  32. Jan HudecAug 20, 2007
  33. David KastrupAug 20, 2007
  34. Mike HommeyAug 20, 2007
  35. David KastrupAug 20, 2007
  36. Shawn O. PearceAug 21, 2007
  37. Junio C HamanoAug 21, 2007
  38. Mike HommeyAug 21, 2007
  39. David KastrupAug 21, 2007

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.