add comment
authorJoey Hess <joeyh@joeyh.name>
Thu, 23 Mar 2023 19:29:53 +0000 (15:29 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 23 Mar 2023 19:29:53 +0000 (15:29 -0400)
doc/bugs/gcrypt_remotes_using_relative_paths/comment_2_45281c947992c2ab124efd0f109255d6._comment [new file with mode: 0644]

diff --git a/doc/bugs/gcrypt_remotes_using_relative_paths/comment_2_45281c947992c2ab124efd0f109255d6._comment b/doc/bugs/gcrypt_remotes_using_relative_paths/comment_2_45281c947992c2ab124efd0f109255d6._comment
new file mode 100644 (file)
index 0000000..4175db0
--- /dev/null
@@ -0,0 +1,36 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 2"""
+ date="2023-03-23T18:27:36Z"
+ content="""
+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:
+
+       ghci> import Network.URI
+       ghci> parseURI "rsync://user@user.rsync.net:relative/path/to/repo.git"
+       Nothing
+
+And Git.GCrypt.encryptedRemote strips off the "gcrypt::",
+leaving that.
+
+       ghci> r
+       Repo {location = LocalUnknown "/home/joey/tmp/bb", config = fromList [], fullconfig = fromList [], remoteName = Nothing, gitEnv = Nothing, gitEnvOverridesGitDir = False, gitGlobalOpts = [], gitDirSpecifiedExplicitly = False}
+       ghci> rr
+       Repo {location = Url gcrypt::rsync://user@user.rsync.net:relative/path/to/repo, config = fromList [], fullconfig = fromList [], remoteName = Just "test1", gitEnv = Nothing, gitEnvOverridesGitDir = False, gitGlobalOpts = [], gitDirSpecifiedExplicitly = False}
+       ghci> encryptedRemote r rr
+       Repo {location = LocalUnknown "/home/joey/tmp/bb/rsync://user@user.rsync.net:relative/path/to/repo.git", config = fromList [], fullconfig = fromList [], remoteName = Nothing, gitEnv = Nothing, gitEnvOverridesGitDir = False, gitGlobalOpts = [], gitDirSpecifiedExplicitly = False}
+       ghci> parseRemoteLocation "rsync://user@user.rsync.net:relative/path/to/repo" r
+       RemotePath "rsync://user@user.rsync.net:relative/path/to/repo"
+
+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.)
+"""]]