Please describe the problem.
Trying to execute an external remote shell script on windows fails.
What steps will reproduce the problem?
$git annex initremote test type=external externaltype=rclone encryption=none
initremote test git-annex: Cannot run git-annex-remote-rclone -- Make sure it's in your PATH and is executable.
What version of git-annex are you using? On what operating system?
windows, using git-bash
git-annex version: 6.20170214-g2233a50
build flags: Assistant Webapp Pairing Testsuite S3(multipartupload)(storageclasses) WebDAV ConcurrentOutput TorrentParser Feeds Quvi
key/value backends: SHA256E SHA256 SHA512E SHA512 SHA224E SHA224 SHA384E SHA384 SHA3_256E SHA3_256 SHA3_512E SHA3_512 SHA3_224E SHA3_224 SHA3_384E SHA3_384 SKEIN256E SKEIN256 SKEIN512E SKEIN512 SHA1E SHA1 MD5E MD5 WORM URL
remote types: git gcrypt p2p S3 bup directory rsync web bittorrent webdav tahoe glacier ddar hook external
local repository version: 5
supported repository versions: 3 5 6
upgrade supported from repository versions: 2 3 4 5
operating system: mingw32 i386
Please provide any additional information below.
I've also tried fooling around with the proxy, which may help with pinpointing the issue?
$ git-annex-remote-rclone
VERSION 1
$ git annex proxy -- git-annex-remote-rclone
git-annex: git-annex-remote-rclone: createProcess: does not exist (No such file or directory)
failed
git-annex: proxy: 1 failed
$ git annex proxy -- which git-annex-remote-rclone
/d/bin/git-annex-remote-rclone
$ git annex proxy -- /d/bin/git-annex-remote-rclone
git-annex: D:/bin/git-annex-remote-rclone: createProcess: invalid argument (Exec format error)
failed
git-annex: proxy: 1 failed
$ git annex proxy -- sh /d/bin/git-annex-remote-rclone
VERSION 1
# End of transcript or log.
Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
Oh yeah! This software is awesome. After getting used to having "dummy" shortcuts to content I don't currently have, with the simple ability to get/drop that content, I can't believe I haven't seen this anywhere before. If there is anything more impressive than this software, it's the support it has had from Joey over all this time. I'd have pulled my hair out long ago. :P
Not sure if this is helpful or relevant, but it may be?
https://github.com/jgm/pandoc/issues/3247#issuecomment-262036875
git-annex on Windows already checks if external special remotes start with #! and tries to handle the shebang, since Windows does not do that natively. That was added in version 6.20160907. (?refactor shebang handling code for wider use)
git-annex proxy
does not do that, and I feel it's out of scope for it to do so. So the proxy stuff you tried is a red herring.It might be useful to use --debug to see what command git-annex tries to execute when running the external special remote program.
Looking into it a bit more, the problem seems to be that findShellCommand expects a path to a file to examine, but when it's used for an external special remote, it's only given the name of the command.
So, I fixed it by searching for the command in the PATH.
I have still not tested if this works on Windows, but probably, I think. As long as PATH is set on Windows at least.