initremote type=git probe uuid

rather than matching path of an existing remote to find the uuid.

The main benefit of this is that locations not using ssh:// will work
now, including both paths and host:/path

The other benefit is that it's a simpler interface, no need to have an
existing remote with the same url and some other name. Although that
will still work of course.

This does rely on tryGitConfigRead working when given a Git.Repo that is
not a remote. Luckily, it works fine that way.

Also, tryGitConfigRead will auto-init a local repo that has a git-annex
branch. I did not enable auto-init of ssh repos though.

The uuid discovery actually happens twice; initremote discovers it,
and uses it to store the special remote config, but does not set it in the
git remote it creates. So the next run of git-annex does uuid discovery
again, and caches it that time. This could be improved for a tiny
speedup, but I didn't want to complicate things for that in this
commit.

Sponsored-by: Dartmouth College's DANDI project
This commit is contained in:
Joey Hess 2022-06-09 13:16:50 -04:00
parent 2f509e529e
commit 14584e7a38
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 33 additions and 35 deletions

View file

@ -66,3 +66,5 @@ above
[[!meta author=yoh]]
[[!tag projects/dandi]]
> [[fixed|done]] --[[Joey]]

View file

@ -0,0 +1,10 @@
[[!comment format=mdwn
username="joey"
subject="""comment 2"""
date="2022-06-09T17:04:23Z"
content="""
Implemented probing of the uuid of the repo location. Which may change
how you use this feature. Although the old roundabout method of having an
existing git remote and running initremote with the same location will
work too, it's not neccessary to do that anymore.
"""]]