I had mentioned that sometimes mode bits effectively interact. Notice the s
in the group section of the mode bits from this line of output you posted:
drwxrwsr-x 8 git git 4.0K 2012-08-27 16:08 .git/
If Git set that bit, then you may need to review Git's security model, because you might be effectively bypassing it by making the changes you are.
Depending on exactly how chmod
is implemented in the kernel you are using, you may be able to remove the s
then if run purely as root
( that is, IF sudo -s
in your environment is indeed equivalent to su -
) , the recursive chmod
should likely behave as you expected.
But if Git set that bit and the original owner and group owner of the directories in the directory tree, ( possible bugs in Git not withstanding ) the bit probably shouldn't be changed, and the changes you are trying to make probably shouldn't be made.
Another possible command to investigate if there are still problems: