Skip to content
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

create -f reports collision where there is none (collides with itself) #3549

Closed
yarikoptic opened this issue Jul 22, 2019 · 0 comments · Fixed by #3552
Closed

create -f reports collision where there is none (collides with itself) #3549

yarikoptic opened this issue Jul 22, 2019 · 0 comments · Fixed by #3552

Comments

@yarikoptic
Copy link
Member

/tmp > datalad create /tmp/topds; cd /tmp/topds/; datalad create subds; git submodule add ./subds ./subds; cd subds; datalad create -f . 
[INFO   ] Creating a new annex repo at /tmp/topds 
create(ok): /tmp/topds (dataset)                                                                                                                                                                                                  
[INFO   ] Creating a new annex repo at /tmp/topds/subds 
create(ok): /tmp/topds/subds (dataset)                                                                                                                                                                                            
Adding existing repo at 'subds' to the index
[ERROR  ] collision with content in parent dataset at /tmp/topds: ['/tmp/topds/subds'] [create(/tmp/topds/subds)] 

/tmp/topds/subds > cd ..

/tmp/topds > git status
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   .gitmodules
	new file:   subds


/tmp/topds > datalad --version
datalad 0.12.0rc4.dev239

subds is the subdataset we are trying to force create here, so there is no collision.

I thought that may be it is due to subds/ being only staged, but even if I commit, situation is the same:

/tmp > datalad create /tmp/topds; cd /tmp/topds/; datalad create subds; git submodule add ./subds ./subds; git commit -m 'added subds'; cd subds; datalad create -f . 
[INFO   ] Creating a new annex repo at /tmp/topds                                                                                       
create(ok): /tmp/topds (dataset)                                                                                                                                                                                                  
[INFO   ] Creating a new annex repo at /tmp/topds/subds 
create(ok): /tmp/topds/subds (dataset)                                                                                                                                                                                            
Adding existing repo at 'subds' to the index
[master 30bc31b] added subds
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 subds
[ERROR  ] collision with content in parent dataset at /tmp/topds: ['/tmp/topds/subds'] [create(/tmp/topds/subds)] 

/tmp/topds/subds > cd ..

/tmp/topds > git status
On branch master
nothing to commit, working tree clean
kyleam added a commit to kyleam/datalad that referenced this issue Jul 23, 2019
If create() is called with an existing subdataset as the path, we
abort saying that the subdataset is content in the parent dataset.
Although this is true, let's restrict this check to non-dataset
content (e.g., <existing subds>/<file>) and have the subdataset case
fall through to the "is subdataset?" check.  This will make it easier
to make 'datalad create --force <existing subds>' ignore the "is
subdataset?" check.

Re: datalad#3549
kyleam added a commit to kyleam/datalad that referenced this issue Jul 23, 2019
For top-level datasets, the --force can be used to ignore the "is
empty directory?" check.  Make --force also disable the "is
subdataset?" check because this is consistent with the non-subdataset
behavior and was the behavior before the "rev-create -> create"
rewrite.

Fixes datalad#3549.
kyleam added a commit to kyleam/datalad that referenced this issue Jul 23, 2019
If create() is called with an existing subdataset as the path, we
abort saying that the subdataset is content in the parent dataset.
Although this is true, let's restrict this check to non-dataset
content (e.g., <existing subds>/<file>) and have the subdataset case
fall through to the "is subdataset?" check.  This will make it easier
to teach 'datalad create --force <existing subds>' to ignore the "is
subdataset?" check.

Re: datalad#3549
kyleam added a commit to kyleam/datalad that referenced this issue Jul 23, 2019
For top-level datasets, --force can be used to ignore the "is empty
directory?" check.  Make --force also disable the "is subdataset?"
check because this is consistent with the non-subdataset behavior and
was the behavior before the "rev-create -> create" rewrite.

Fixes datalad#3549.
kyleam added a commit to kyleam/datalad that referenced this issue Jul 23, 2019
If create() is called with an existing subdataset as the path, we
abort saying that the subdataset is content in the parent dataset.
Although this is true, let's restrict this check to non-dataset
content (e.g., <existing subds>/<file>) and have the subdataset case
fall through to the "is subdataset?" check.  This will make it easier
to teach 'datalad create --force <existing subds>' to ignore the "is
subdataset?" check.

Re: datalad#3549
kyleam added a commit to kyleam/datalad that referenced this issue Jul 23, 2019
For top-level datasets, --force can be used to ignore the "is empty
directory?" check.  Make --force also disable the "is subdataset?"
check because this is consistent with the non-subdataset behavior and
was the behavior before the "rev-create -> create" rewrite.

Fixes datalad#3549.
@mih mih closed this as completed in #3552 Jul 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant