Thread (13 messages) flat view 13 messages, 3 authors, 2016-06-15

Git changes permissions on directories when deleting files.

From: Chad Joan <hidden>
Date: 2016-06-15 22:50:41

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help