Skip to content

Commit

Permalink
Apply one more suggestion from code review
Browse files Browse the repository at this point in the history
This adds a note to the datalad access documentation, advising users
that cloning from an incorrect datalad-annex URL will not cause an
error, but instead produce an empty repository.

Suggested-by: Adina Wagner <[email protected]>
  • Loading branch information
mslw committed Jan 10, 2024
1 parent 3e8f484 commit 9d1a839
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docs/source/user/datalad-access.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,19 @@ A full ``datalad clone`` command could then look like this:
.. code-block::
datalad clone 'datalad-annex::?type=external&externaltype=uncurl&encryption=none&url=file:///tmp/local_dicom_store/dl-Z03/P000624_{{annex_key}}' my_clone
.. note::

The clone command will not fail if the ``datalad-annex::`` URL
points to a nonexisting target. If you see the following warning:

.. code-block:: none
[WARNING] You appear to have cloned an empty repository.
[WARNING] Cloned /path/to/my_clone but could not find a branch with commits
it is likely that the provided URL is mistyped or otherwise not correct.


.. note:: The URL is arguably a bit clunky. A convenience short cut can be provided via configuration item ``datalad.clone.url-substitute.<label>`` and a substitution rule based on regular expressions. For example, clone URLs can be shortened to require only an identifier (here, ``file:///data/group/groupname/local_dicom_store``), study ID, and visit ID (``inm-icf/<study-ID>/<visit-ID>``) with the following configuration:

Expand All @@ -54,6 +66,7 @@ A full ``datalad clone`` command could then look like this:
You are free to adjust this configuration custom to your needs and preferences.
Further documentation on it can be found in the `DataLad Docs`_.


.. _DataLad Docs: http://docs.datalad.org/en/stable/design/url_substitution.html

Cloning will retrieve a lightweight dataset, which does not (yet)
Expand Down

0 comments on commit 9d1a839

Please sign in to comment.