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

Re: Honor extractor's umask in git-tar-tree.

From
Junio C Hamano <junkio@cox.net>
Date
Oct 3, 2005, 17:18 UTC
Message-ID
<7v8xxasenp.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<43415C9A.1090502@zytor.com>
"H. Peter Anvin" <hpa@zytor.com> writes:
> As you stated above, we currently use this field in a very inefficient 
> manner, because of old mistakes.  There are several ways to recover from 
> here, some of which are more complex than others.

Solution for in-tree permission mode bits you outlined looked fine (I'll have to re-read the part about "mode xor (mode & 022)..." part later, though).

For in-cache permission mode bits, we would probably need something like this:

  * git-update-index will pick up the filesystem bits with the
    current semantics (i.e. look only at (mode & 0100) and
    force 0644 or 0755) by default; --full-perm-bits option
    would bypass this bits munging.
    Once a file is added with --full-perm-bits, it might be
    nice if index file remembers to pick up the full bits next
    time git-update-index is run on the path.  This could be
    achieved by saying that anything stored in the cache with
    non 100644, 100755 nor 120000 bits are such paths without
    having to change the index file format.
  * there are bunch of codes that assume 0644 and 0755 are the
    norm but also know that there are ancient trees that have
    0664 and 0775 and try to treat them equivalently.  They need
    to be selectively neutered; this applies to in-tree
    permission bits as well.
    git-read-tree will read permission mode bits from tree
    object as-is.  I.e. you will get 0644 and 0755 in cache from
    the existing tree objects.  When you check things out with
    002 umask, you will get 0664 and 0775 on the filesystem.  We
    do not want to consider this "mode changed by the user".
    git-update-index --refresh code should not be mode neutered
    to prevent this.  The same thing goes for diff.  These
    currently canonicalize mode bits by looking at (mode &
    0100), but should be changed to do so only when index has
    already the canonical mode bits, or something like that.
  * git-write-tree and git-fsck-objects probably has code to
    reject and correct abnormal mode bits.  They need to be
    neutered.
Previous: H. Peter AnvinNext: H. Peter Anvin
Message 11 of 18 in “Destructive side-effect of "cg-status"”
  1. Wolfgang DenkSep 30, 2005
  2. Martin LanghoffOct 1, 2005
  3. Linus TorvaldsOct 1, 2005
  4. Junio C HamanoOct 1, 2005
  5. Honor extractor's umask in git-tar-tree.Junio C Hamano, Oct 1, 2005
  6. H. Peter AnvinOct 2, 2005
  7. Matthias UrlichsOct 2, 2005
  8. H. Peter AnvinOct 3, 2005
  9. Junio C HamanoOct 3, 2005
  10. H. Peter AnvinOct 3, 2005
  11. Junio C HamanoOct 3, 2005
  12. H. Peter AnvinOct 3, 2005
  13. Linus TorvaldsOct 3, 2005
  14. H. Peter AnvinOct 3, 2005
  15. Linus TorvaldsOct 3, 2005
  16. H. Peter AnvinOct 3, 2005
  17. Wolfgang DenkOct 1, 2005
  18. Linus TorvaldsOct 1, 2005

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.