Description of problem: On Windows-8, the execute permission of build action_hooks will be lost during git push. But for linux, it won't happen in linux. Version-Release number of selected component (if applicable): INT(deven_3395) rhc-1.10.5 ruby-2.0 window-8 Git Bash How reproducible: alway Steps to Reproduce: 1. use "git bash" tool, rhc app create mypy26 python-2.6 2. cd mypy26 and echo "date" >.openshift/action_hooks/build 3. ls -l .openshift/action_hooks/build and find the permissoion of file is 755 4. git add -A && git commit -amp && git push 5. the permission of ".openshift/action_hooks/build" changed into 644 during git push Actual results: build action_hooks lose execute permission during git push and didn't execute during deploying. Expected results: build action_hooks should have execute permission during git push and will execute during deploying. Additional info: openshift@OPENSHIFT-WIN8 ~/mypy26 (master) $ ls -l .openshift/action_hooks/build -rwxr-xr-x 1 openshif Administ 154 Jun 21 10:30 .openshift/action_hooks/ build openshift@OPENSHIFT-WIN8 ~/mypy26 (master) $ git add -A && git commit -amp && git push warning: LF will be replaced by CRLF in .openshift/action_hooks/build. The file will have its original line endings in your working directory. [master bc8fd86] p warning: LF will be replaced by CRLF in .openshift/action_hooks/build. The file will have its original line endings in your working directory. 1 file changed, 10 insertions(+) create mode 100644 .openshift/action_hooks/build
There are two possible workarounds for this: $ git config core.filemode false <cite> core.fileMode If false, the executable bit differences between the index and the working copy are ignored; useful on broken filesystems like FAT. See git-update-index(1). True by default </cite> OR to fix file permissions on Windows: $ git update-index --chmod=+x <file> Is this reasonable workaround for you or do you think we should do more care on openshift side?
Yeah, Thanks for your workaround. I use 'git update -index --chmod+x <file>', and git push .openshift/action_hooks/build, It can be executed. I also don't think we should do more care, since action_hooks build can work on windows
No changes needed on the Cartridge side for this. I added documentation note for Windows users: https://github.com/openshift/origin-server/pull/4088
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/17e3f3577c68b67b30719ed22bf8b2da8b251d75 Bug 976740 - Document the wrong permissions of action hooks on Windows
Verified on devenv_3992, related doc has been changed. origin-server/documentation/oo_user_guide.adoc Note: On Windows, the execute permissions of an action hook files will be lost during the git push. To fix this problem, you can run this command: ---- # git update-index --chmod=+x .openshift/action_hooks/* # git push ----