Current docs
The documentation for datalad get (section: getting subdatasets) says:
Additional candidate URLs can be generated based on templates specified as configuration variables with the pattern
datalad.get.subdataset-source-candidate-<name>
(...)
Additionally, the URL of any configured remote that contains the respective submodule commit is available as remote-<name> properties, where NAME is the configured remote name.
Current code
However, the code of _get_flexible_source_candidates_for_submodule() caters for remoteurl-<name> property, not remote-<name>:
|
# Directly on parent's ds url |
|
if remote_url: |
|
# make remotes and their URLs available to template rendering |
|
sm_candidate_props['remoteurl-{}'.format(remote)] = remote_url |
Practical example
Tested in practice, where ../foo/bar is the url of the origin remote:
- With source candidate
{remote-origin}/{path} given 000 priority it doesn't work:
[WARNING] Failed to format template '{remote-origin}/{path}' for a submodule clone. Error: KeyError('remote-origin')
[DEBUG ] Assembled 2 clone candidates for bar: ['https://github.com/mslw/foo-bar.git', '../foo/bar']
With source candidate {remoteurl-origin}/{path} given 000 priority it works, and moves origin ahead of the URL from .gitmodules:
[DEBUG ] Assembled 2 clone candidates for bar: ['../foo/bar', 'https://github.com/mslw/foo-bar.git']
Discovered thanks to this Neurostars question
Current docs
The documentation for datalad get (section: getting subdatasets) says:
Current code
However, the code of
_get_flexible_source_candidates_for_submodule()caters forremoteurl-<name>property, notremote-<name>:datalad/datalad/distribution/get.py
Lines 207 to 210 in 928498e
Practical example
Tested in practice, where
../foo/baris the url of the origin remote:{remote-origin}/{path}given 000 priority it doesn't work:With source candidate
{remoteurl-origin}/{path}given 000 priority it works, and moves origin ahead of the URL from.gitmodules:Discovered thanks to this Neurostars question