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

Re: preserve permissions?

From
Jakub Narebski <jnareb@gmail.com>
Date
Mar 3, 2012, 19:15 UTC
Message-ID
<m3wr71ts0i.fsf@localhost.localdomain>
In-Reply-To
<1330801530552-7340464.post@n2.nabble.com>
snk <shank76@gmail.com> writes:
> > Therefore git does not store ownership, and only basic permissions 
> > (only executable bit for ordinary files, and the symlink bit). 
> 
> Fine.  "git diff" reports wrong new permissions though: 755 instead of 764. 
"Executable bit" is not "executable permissions"
 
Show 14 quoted lines
> shanker@linux-0tix:~/test/play2> git reset --hard HEAD
> HEAD is now at 85d4483 test
> shanker@linux-0tix:~/test/play2> git config core.filemode
> true
> shanker@linux-0tix:~/test/play2> ls -l x
> -rw-rw-r-- 1 shanker users 0 Mar  3 11:00 x
> shanker@linux-0tix:~/test/play2> chmod u+x x
> shanker@linux-0tix:~/test/play2> git diff x
> diff --git a/x b/x
> old mode 100644
> new mode 100755
> shanker@linux-0tix:~/test/play2> ls -l x
> -rwxrw-r-- 1 shanker users 0 Mar  3 11:00 x
> shanker@linux-0tix:~/test/play2> 

Git stores only whether file is executable or not. To be more exact git uses only a few modes: one for submodule (commit), one for directory, one for symbolic link, one for ordinary executable file, and one for ordinary file (non-executable).

-- 
Jakub Narebski
Previous: snkNext: Andrew Keller
Message 4 of 5 in “preserve permissions?”
  1. Jonathan ChetwyndMay 4, 2010
  2. Jakub NarebskiMay 4, 2010
  3. snkMar 3, 2012
  4. Jakub NarebskiMar 3, 2012
  5. Andrew KellerMay 4, 2010

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.