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

Git changes permissions on directories when deleting files.

From
Chad Joan <chadjoan@gmail.com>
Date
Mar 1, 2011, 01:42 UTC
Message-ID
<AANLkTikJcOgBAZS=cCWULFYz4U_Mxx1gFMg51+r9qDo0@mail.gmail.com>
Hello,
What I'm experiencing is this:

$ cd ~/project $ ls -dl somedir drwxrwx--- 1 cjoan cjoan 0 Feb 28 19:57 somedir $ echo "some text" > somedir/somefile.txt $ git add somedir/somefile.txt $ git rm -f somedir/somefile.txt rm 'somedir/somefile.txt' $ ls -dl somedir drw------- 1 cjoan cjoan 0 Feb 28 19:57 somedir $ echo "some text" > somedir/somefile.txt bash: somedir/somefile.txt: Permission denied

~/project is actually a CIFS mount, with the host being an OpenVMS machine.

If I use the normal rm command without using git then the permissions will remain the same on 'somedir'.  This is why I suspect (and hope) this isn't OpenVMS related.

It seems that execute bit is important for CIFS mounted files, because after this happens I am no longer able to do /anything/ within the 'somedir' directory.  This also affects branches via "git checkout branchname": if the checkout happens to delete files then this will happen, and it will salt the wound by failing to sync a bunch of files in 'somedir' (because I can't access them anymore) while still moving HEAD to the new branch.

The share on the CIFS host looks like this:
[homes]
        comment = Home Directories
        read only = No
        create mask = 0770
        browseable = No
        vfs objects = varvfc
        vms path names = No
        case sensitive = Yes
The fstab entry for the mount looks like this:

//vms/homes  /home/cjoan/project  cifs credentials=/home/cjoan/.cifs_credentials,_netdev,uid=cjoan,gid=cjoan 0 0

I'd really like my directories to keep their permissions. Any idea what might cause this?

- Chad
Next: Chad Joan
Message 1 of 19 in “Git changes permissions on directories when deleting files.”
  1. Chad JoanMar 1, 2011
  2. Chad JoanMar 1, 2011
  3. Computer DruidMar 1, 2011
  4. Chad JoanMar 1, 2011
  5. Chad JoanMar 1, 2011
  6. Computer DruidMar 1, 2011
  7. Chad JoanMar 1, 2011
  8. Jeff KingMar 1, 2011
  9. Chad JoanMar 1, 2011
  10. Jeff KingMar 1, 2011
  11. Chad JoanMar 1, 2011
  12. Computer DruidMar 1, 2011
  13. Jeff KingMar 1, 2011
  14. Matthieu MoyMar 1, 2011
  15. Chad JoanMar 1, 2011
  16. Jeff KingMar 1, 2011
  17. Chad JoanMar 3, 2011
  18. Jeff KingMar 3, 2011
  19. Chad JoanMar 11, 2011

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.