git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* confused about preserved permissions
@ 2007-08-20 16:44 martin f krafft
  2007-08-20 16:54 ` Pierre Habouzit
                   ` (3 more replies)
  0 siblings, 4 replies; 39+ messages in thread
From: martin f krafft @ 2007-08-20 16:44 UTC (permalink / raw)
  To: git discussion list

[-- Attachment #1: Type: text/plain, Size: 2495 bytes --]

Hello,

I am a bit confused about how git stores and restores permissions.
I went to the web but found little other than this post from Linus
in 2005:

  http://www.gelato.unsw.edu.au/archives/git/0504/0870.html

where he basically says that git will *not* save permissions and
that it also does not save symlinks. I thus discarded the
information as being outdated. I have also looked into the source,
but the following question is more about git design than
implementation.

Let me illustrate the source of my confusion:

  $ git init
  Initialized empty Git repository in .git/
  $ umask
  002
  $ date > file1; ls -l file1
  -rw-rw-r-- 1 madduck madduck 30 2007-08-20 18:15 file1
  $ git add file1; git commit -m.
  Created initial commit 5762460: .
  1 files changed, 1 insertions(+), 0 deletions(-)
  create mode 100644 file1

file1 is mode 664, but gut says "create mode 100644 file1",
independently of whether I use --shared when initialising, or what
value I set it to. Why does it override the group write bit?

But it gets worse:

  $ git checkout -b t
  Switched to a new branch "t"
  $ git rm file1; git commit -m.
  rm 'file1'
  Created commit a813b4e: .
  1 files changed, 0 insertions(+), 1 deletions(-)
  delete mode 100644 file1
  $ umask 007
  $ git checkout master
  Switched to branch "master"
  $ ls -l file1
  -rw-rw----  1 madduck madduck    30 2007-08-20 18:15 file1

So git doesn't even restore 644 when I switch branches, nor on
initial clone, or on re-checkout after removing the local copy.

Am I doing something wrong?

Why does git bother saving a mode when later it never seems to use
it again?

And is there a way to tell git not to mess with the permissions in
the worktree when switching branches? I am not sure what's causing
it since the inode of files does not seem to change, so git
apparently explicitly fchmod()'s files.

I'd be grateful for any documentation to read in addition to the
code. I saw core.filemode, but that's only about the x bit, it
seems.

Thanks,

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
 
"vista is evidentally latvian for "hen", and "perating system", that
 is, OS without the o, means "system for making eggs."  so vista is at
 least useful come breakfast time?"
                                                      -- kit la touche
 
spamtraps: madduck.bogus@madduck.net

[-- Attachment #2: Digital signature (see http://martin-krafft.net/gpg/) --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2007-09-03 19:01 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-20 16:44 confused about preserved permissions martin f krafft
2007-08-20 16:54 ` Pierre Habouzit
2007-08-20 17:38   ` martin f krafft
2007-08-20 17:41 ` Mike Hommey
2007-08-20 17:58   ` David Kastrup
2007-08-20 18:13     ` Mike Hommey
2007-08-20 18:44       ` David Kastrup
     [not found]       ` <86zm0mgicy.fsf@lola.quinscape.zz>
2007-08-20 18:48         ` Mike Hommey
2007-08-20 19:43           ` Jan Hudec
2007-08-20 19:50             ` Mike Hommey
2007-08-20 20:07               ` Alex Riesen
2007-08-20 20:10                 ` Mike Hommey
2007-08-20 20:27                   ` Jan Hudec
2007-08-20 20:42                   ` David Kastrup
2007-08-20 20:44                     ` Mike Hommey
2007-08-20 20:08               ` Jan Hudec
2007-08-20 20:39           ` David Kastrup
2007-08-20 20:50             ` Mike Hommey
2007-08-20 21:03               ` David Kastrup
2007-08-21  1:35               ` Shawn O. Pearce
2007-08-21  2:06                 ` Junio C Hamano
2007-08-21  5:34                   ` Mike Hommey
2007-08-21  6:04                     ` David Kastrup
2007-08-21 18:01   ` René Scharfe
2007-08-21 18:01   ` [PATCH] Documentation: update tar.umask default René Scharfe
2007-08-21 21:15     ` Mike Hommey
2007-08-22 21:03       ` René Scharfe
2007-08-20 18:35 ` confused about preserved permissions Alex Riesen
2007-08-22 12:18 ` Benoit SIGOURE
2007-08-22 12:52   ` Johannes Sixt
2007-08-22 22:09   ` Junio C Hamano
2007-08-23  6:00     ` martin f krafft
2007-08-23  6:12       ` David Kastrup
2007-08-23  6:23         ` martin f krafft
2007-08-23  7:48         ` Benoit SIGOURE
2007-08-23  7:57           ` Junio C Hamano
2007-08-23  8:08             ` David Kastrup
2007-09-03 18:59           ` Jan Hudec
2007-08-23  7:03       ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).