From my experimentation it seems to be that git-annex does not discover the annex.url config after the initial clone of a repository. There are at least two situations in which this would be useful though:
- If the server-side supports p2phttp, but the repository is cloned with an older version of git-annex that doesn't, the annexurl won't be picked up even if the client-side git-annex is later updated to a version that does support p2phttp.
- Likewise, if the server-side initially didn't support p2phttp and didn't set
annex.urlwhen the repository was cloned, but is later updated to support it, git-annex doesn't automatically pick up this change.
This automatic discovery would be nice for p2phttp support in forgejo-aneksajo, as existing clones could automatically start making use of it as soon as the instance is updated to support it on the server-side and the git-annex version is updated to be recent enough on the client-side.
annex.urlsetting by unsettingremote.<name>.annex-uuidand then doinggit annex initagain or trying to copy something to the remote.<owner>/<repo>routing namespace. Having git-annex retrieve updated config data from remotes would make this change propagate to clones automatically, which would be nice I think.Even if it only re-checks when git-annex is going to use the remote (and not on every run of git-annex) that seems perhaps too often to check.
But if it checks less often than that, once per day or whatever, there will of course be a window where it has not yet noticed the change and uses the cached remote.name.annexUrl and potentially fails.
A balance might be that if it fails to connect to the remote.name.annexUrl, it could re-check it then.
Would this include re-checking when remote.name.annexUrl is unset? That would be necessary in the situations where either the client didn't understand p2phttp when the repository was closed or when the server-side didn't provide p2phttp yet.
Given that the clone happened in the knowledge that "dumb http" was the only supported http protocol and read only, I am now questioning if such a automatic upgrade to p2phttp would really be needed, or even desirable. Dumb http continues to work anyway.
Only re-checking if remote.name.annexUrl is set already would solve the issue of relocating the p2phttp endpoint.
If that would mean checking on every use of the remote, it seems too often.
And even Debian stable now includes a new enough git-annex to support p2phttp, so the benefits of that check are more limited now to detecting server-side changes.
I think that's a good point.
So I'm inclined to make this todo only about re-checking when remote.name.annexUrl is configured to a annex+http url and it fails to connect.
I've implemented re-checking of the annex.url config when remote.name.annexUrl is configured to an annex+http url.
Going to close this, but if you also need it when remote.name.annexUrl is not configured, let me know.