Please describe the problem.
git annex sync
is not automatically run for gcrypt remotes using rsync with a relative path
What steps will reproduce the problem?
Flow 1 (relative path, broken)
git remote add test gcrypt::rsync://user@user.rsync.net:relative/path/to/repo
git annex sync
-> DOES NOT SYNC to test remote- Nothing has been synced so I CANNOT successfully clone from the test remote with
git clone gcrypt::rsync://user@user.rsync.net:relative/path/to/repo
git push test git-annex master
- I can successfully clone from the test remote with
git clone gcrypt::rsync://user@user.rsync.net:relative/path/to/repo
Flow 2 (absolute path, working)
git remote add test gcrypt::rsync://user@user.rsync.net/full/path/to/repo
git annex sync
-> DOES SYNC to test remote- I can successfully clone from the test remote with
git clone gcrypt::rsync://user@user.rsync.net:relative/path/to/repo
What version of git-annex are you using? On what operating system?
- Debian 11
- git-annex version: 10.20230227
- git-remote-gcrypt version 1.5
Please provide any additional information below.
# If you can, paste a complete transcript of the problem occurring here.
# If the problem is with the git-annex assistant, paste in .git/annex/daemon.log
# 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)
I am VERY happy with git annex and am using it successfully with a gcrypt remote using an absolute path
The lack of a transcript made this bug hard to understand. After about half an hour of staring at it, I realized that you mean that
git-annex sync
does not even attempt to sync with the remote when it has the relative url:It does sync with it when asked to sync with explicitly that remote:
With the absolute url, it does sync with it when no remote is explicitly specified.
Analysis: When parsing the relative url, git-annex ends up constructing a Repo with location
LocalUnknown "./rsync://user@user.rsync.net:relative/path/to/repo.git"
So, it thinks it's a local git repository, which of course does not exist, so it skips syncing with it.
Why does it do that? Well:
And Git.GCrypt.encryptedRemote strips off the "gcrypt::", leaving that.
parseRemoteLocation uses isURI and that does not parse as a valid URI.
So Git.GCrypt.encryptedRemote will need to force it to parse as an url in this case.
(I remember that I fixed git-remote-gcrypt to support absolute urls for related reasons. Those relative nonstandard urls are not a good idea.)