I have a remote that I use to keep backups of some git repo for compiling D toolchains. Normally I will do the git pull and compilation locally then rclone sync the results for backup. Recently I tried to do git pull directly on the mounted remote just as an experiment. It seems to work but fails at the step where it needs to update some refs. Should this even work with rclone’s vfs or would I need to use overlayfs/unionfs/mergefs or one of their kins?
Well on the git end it is error: cannot update the ref 'refs/remotes/origin/master': unable to append to '.git/logs/refs/remotes/origin/master': Bad file descriptor
On the mount end, the log says either DEBUG : fuse: -> [ID=0xf36] Read error=bad file descriptor or DEBUG : fuse: -> [ID=0xf86] Lookup error=ENOENT
The file is opened write only and append, but then read from. Rclone returns EBADF for that which according to the man page for write(2) is the correct thing to return
EBADF fd is not a valid file descriptor or is not open for reading.
Why git does that, I don’t know…
It might be worth stracing git to see if that is what it thinks it is doing or whether something has got lost in translation in the kernel/FUSE layers
Hm, yeah I don’t get it. Git is weird… This is a strace of a git clone instead of git pull as I’ve already updated the dmd repo
[ocelot@yellowtrain gitDToolChain]$ strace -yy -o ~/gitstrace git clone --verbose https://github.com/dlang/dmd.git ~/eDevelopments/gitDToolChain/dmd-test
Cloning into '/home/ocelot/eDevelopments/gitDToolChain/dmd-test'...
fatal: Unable to read current working directory: No such file or directory
There’s clearly a dmd-test directory on that remote. I created it before issuing the git clone command
So it seems that git expects a .git directory but doesn’t make one if it doesn’t exits like it would normally if cloning locally…Hm non-existent directory being open readonly is really fishy…
I’m not sure what is going on there! I tried the clone command to a local disk which worked fine, and then to google drive which took ages but appeared to be working…
I think there are corner cases in rclone mount which still need to be wrinkled out. For example this issue: https://github.com/ncw/rclone/issues/3006 and I guess git is hitting those, being quite an intensive file system user. If we can figure out exactly what is happening then I’m sure I can fix it!
In fact git operations are probably a good test - maybe I could make a test suite for rclone mount using them…