summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-01-20 13:39:07 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-01-20 14:48:16 -0400
commitce0693bea2f03ed979258baac7409f210633e397 (patch)
tree53c10d6cbb0e3b55466ca62f19dbaa0e58ec5aa5 /doc
parent155ff5705916e5b3d4749fde901a3d40ce1c9740 (diff)
Windows: Fix running of the pre-commit-annex hook.
Diffstat (limited to 'doc')
-rw-r--r--doc/bugs/windows_isExecutable_fail.mdwn27
-rw-r--r--doc/tips/automatically_adding_metadata/comment_6_34f0c55d09ddee3de642f6b25a9f6269._comment9
2 files changed, 36 insertions, 0 deletions
diff --git a/doc/bugs/windows_isExecutable_fail.mdwn b/doc/bugs/windows_isExecutable_fail.mdwn
new file mode 100644
index 000000000..41e5b29a2
--- /dev/null
+++ b/doc/bugs/windows_isExecutable_fail.mdwn
@@ -0,0 +1,27 @@
+On Windows, isExecutable fails to detect a file that is indeed executable
+as such. This prevents git-annex from running the pre-commit-hook
+on Windows.
+
+getFileStatus yields a fileMode of 100666, which is
+clearly a dummy mode. Not surprising, since unix-compat is partial stubs
+on windows.
+
+Actually, isExecutable is ok (it needs to check unix modes because it is
+used on file modes coming out of git). But, getFileStatus is the wrong
+thing to be using on Windows to check if a hook exists and is executable.
+
+I don't see anything in Win32 or Win32-extras on hackage that can check
+executablility. Looking at git's source, it uses `access(path, X_OK) < 0`;
+haskell equivilant is System.Posix.Files.fileAccess, but the version
+in unix-compat has the same problem as checking getFileStatus's fileMode.
+
+I think it's reasonable to assume that if a hook exists on windows, it's
+intended to be executable, and try to run it. Actually, testing with
+msysgit, it runs hooks whether or not they have the execute bit set!
+So, done that now.
+
+However, now git-annex tries to run the hook but fails when it's a shell
+script because #!/bin/sh is useless on windows. It looks to me like msysgit
+runs "sh hook" to work around that, and it is in fact parsing the shebang
+line and dispatching the interpreter. Ugh. (Also, pre-commit.bat doesn't
+get run.) Ok, added this same hack to git-annex. [[done]] --[[Joey]]
diff --git a/doc/tips/automatically_adding_metadata/comment_6_34f0c55d09ddee3de642f6b25a9f6269._comment b/doc/tips/automatically_adding_metadata/comment_6_34f0c55d09ddee3de642f6b25a9f6269._comment
new file mode 100644
index 000000000..ab5bc7b76
--- /dev/null
+++ b/doc/tips/automatically_adding_metadata/comment_6_34f0c55d09ddee3de642f6b25a9f6269._comment
@@ -0,0 +1,9 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 6"""
+ date="2015-01-20T17:19:34Z"
+ content="""
+@Michele after testing, git-annex on Windows seems to not see a file that
+does have the executable bit set as executable. I have opened a bug report
+[[bugs/windows_isExecutable_fail]], and worked around the problem now.
+"""]]