New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undesired submodule url #3538
Labels
Comments
mih
added a commit
to mih/datalad
that referenced
this issue
Jan 10, 2020
Git turns these into absolute paths, but relpath specification might actually be useful for discovery, e.g. when datasets are still stored in the same relative locations, but were jointly moved from an original to a new absolute path. Fixes dataladgh-3538
kyleam
added a commit
to kyleam/datalad
that referenced
this issue
Jan 15, 2020
When git clone is called with a local relative path as the URL, it will prepend the current working directory to the URL to get an absolute path. "../" components are retained. In common DataLad scenarios (see dataladgh-3538), installing a subdataset using a local path source can lead to .git/config URLs such as url = /tmp/super/../source A downside of these absolute paths is that they become invalid for URLs that point within a dataset hierarchy (e.g., "../../source") if the hierarchy is moved to a different location. With relative URLs, the URLs would remain valid as long the relative relationships are retained. (On the other hand, absolute paths provide a better stability when moving datasets if the URLs point outside of the hierarchy.) Two recent commits from dataladgh-3966, 02e2b4c (BF: Avoid relpath mangling for submodule url configuration, 2020-01-10) followed up by 0a80bb4 (BF: submodule relpath must start with ./ or ../, 2020-01-10), tried to avoid these absolute URLs. The combined result says "if the URL given is a local path and is relative, overwrite the configured URL with that path (prepending ./ if the path doesn't start with ../)". However, this logic points the URL to the wrong location. Here are some examples (similar to the cases the added test): * For `git clone a b`, the correct location from _within_ repo b would "../a", not "./a". * Similarly, for `git clone ../a b`, the correct location would be "../../a", not "../a" * Calling `git clone a ../b` from $DIR, the correct location would "$DIR/a", not "./a". An alternative approach is needed, but it seems unlikely to have a quick and obviously correct fix, so let's revert the changes from 02e2b4c and 0a80bb4 to avoid these invalid URLs. Re-opens dataladgh-3538.
kyleam
added a commit
to kyleam/datalad
that referenced
this issue
Jan 15, 2020
When git clone is called with a local relative path as the URL, it will prepend the current working directory to the URL to get an absolute path. "../" components are retained. In common DataLad scenarios (see dataladgh-3538), installing a subdataset using a local path source can lead to .git/config URLs such as url = /tmp/super/../source A downside of these absolute paths is that they become invalid for URLs that point within a dataset hierarchy (e.g., "../../source") if the hierarchy is moved to a different location. With relative URLs, the URLs would remain valid as long the relative relationships are retained. (On the other hand, absolute paths provide a better stability when moving datasets if the URLs point outside of the hierarchy.) Two recent commits from dataladgh-3966, 02e2b4c (BF: Avoid relpath mangling for submodule url configuration, 2020-01-10) followed up by 0a80bb4 (BF: submodule relpath must start with ./ or ../, 2020-01-10), tried to avoid these absolute URLs. The combined result says "if the URL given is a local path and is relative, overwrite the configured URL with that path (prepending ./ if the path doesn't start with ../)". However, this logic points the URL to the wrong location. Here are some examples (similar to the cases the added test): * For `git clone a b`, the correct location from _within_ repo b would "../a", not "./a". * Similarly, for `git clone ../a b`, the correct location would be "../../a", not "../a" * Calling `git clone a ../b` from $DIR, the correct location would "$DIR/a", not "./a". An alternative approach is needed, but it seems unlikely to have a quick and obviously correct fix, so let's revert the changes from 02e2b4c and 0a80bb4 to avoid these invalid URLs. Re-opens dataladgh-3538.
Reverted in 0.12.1, but a new approach has been proposed in gh-4026. |
bpoldrack
pushed a commit
to bpoldrack/datalad
that referenced
this issue
Jan 24, 2020
When git clone is called with a local relative path as the URL, it will prepend the current working directory to the URL to get an absolute path. "../" components are retained. In common DataLad scenarios (see dataladgh-3538), installing a subdataset using a local path source can lead to .git/config URLs such as url = /tmp/super/../source A downside of these absolute paths is that they become invalid for URLs that point within a dataset hierarchy (e.g., "../../source") if the hierarchy is moved to a different location. With relative URLs, the URLs would remain valid as long the relative relationships are retained. (On the other hand, absolute paths provide a better stability when moving datasets if the URLs point outside of the hierarchy.) Two recent commits from dataladgh-3966, 02e2b4c (BF: Avoid relpath mangling for submodule url configuration, 2020-01-10) followed up by 0a80bb4 (BF: submodule relpath must start with ./ or ../, 2020-01-10), tried to avoid these absolute URLs. The combined result says "if the URL given is a local path and is relative, overwrite the configured URL with that path (prepending ./ if the path doesn't start with ../)". However, this logic points the URL to the wrong location. Here are some examples (similar to the cases the added test): * For `git clone a b`, the correct location from _within_ repo b would "../a", not "./a". * Similarly, for `git clone ../a b`, the correct location would be "../../a", not "../a" * Calling `git clone a ../b` from $DIR, the correct location would "$DIR/a", not "./a". An alternative approach is needed, but it seems unlikely to have a quick and obviously correct fix, so let's revert the changes from 02e2b4c and 0a80bb4 to avoid these invalid URLs. Re-opens dataladgh-3538.
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Originally at #2601
datalad install -d . -s ../raw sourcedata --reckless
leads to
The text was updated successfully, but these errors were encountered: