-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
dvc add produces /tmp in .dvc/.gitignore #3561
Comments
@RomanVeretenov Does it happen after specific dvc command? |
@RomanVeretenov Could you show us |
@efiop it happens on older repos. Try to clone our get started and run a few commands (pull, checkout, etc). |
output is empty |
@shcheklein It does, but it only adds the missing @RomanVeretenov Ok, that is bad, it means that git is not seeing that Could you show:
please? So far this looks like there is something wrong with your environment or git specifically. |
yep, the repo root is '/home/ds' =) |
@RomanVeretenov Using Need to check your |
There is no /home/.gitignore
also I have recursively listed all gitignore's
Each |
@RomanVeretenov Could you try to reproduce it with a newly created dvc project? E.g.
I'm still not able to reproduce your issue, most likely there is something off with your environment, can't put my finger on anything yet. |
It works ok on a clean repo
after executing all given commands |
@RomanVeretenov So there is something with your .gitignores in the rest of the project. You'll have to take a look and see what is different between it and a clean one. It might be .gitignores somewhere, might be the fact that you are in |
Please let us know how it goes. I'll close this issue for now. |
When what does also, what will the script like this return in your case:
I wonder if it's some yet-another-gitpython's-bug. |
@shcheklein Already checked: #3561 (comment) , it is not gitpython. |
sorry, missed that ... this is really weird! @RomanVeretenov can you just do it all manually. Save the old Do you use submodules or any other advanced Git's stuff? |
Will re-check everything next week |
I was having this issue and discussed it with Ivan on Discord. Here is part of our conversation.
I tried DVC destroy and started again. Didn't help. The only thing that worked is that I started with a clean models folder, added to dvc/git/.gitignore, and then added the data to it. |
From https://discordapp.com/channels/485586884165107732/563406153334128681/703247236368302091
So looks like we should handle it better on DVC side. I suppose @RomanVeretenov had something similar. Reopening |
Ok, looks like we broke
EDIT: it was an older bug after all. |
Big thanks to @ammarasmro for investigating! 🙏 |
Glad I could help :) |
Current implementation doesn't work with directories, which results in hard-to-debug bugs like iterative#3561. The bug that made us walk through index manually is now fixed in gitpython, so we can simply use `ls_files` from now on. Added some tests to prevent this from happening in the future. Fixes iterative#3561
@RomanVeretenov @ammarasmro Guys, could you please try installing dvc from master via |
I got this error ERROR: output 'models' is already tracked by SCM (e.g. Git) It might help to add a suggestion on how to proceed. Like do they just need to delete the files? Add it to |
@ammarasmro Great point! Created #3678 for that. |
I don't think this issue has been resolved. I noticed that this issue was happening even for a fresh
|
Hi @nickdelgrosso ! Sorry for the delay. So dvc actually uses Line 189 in 815444f
|
Yep, that's exactly what I did. My mistake--just wanted to share in case
someone else did the same thing.
…On Thu, Jul 30, 2020, 5:42 AM Ruslan Kuprieiev ***@***.***> wrote:
Hi @nickdelgrosso <https://github.com/nickdelgrosso> ! Sorry for the
delay. So dvc actually uses git check-ignore,
https://github.com/iterative/dvc/blob/815444ffdc5f00e0ae031c3d72dd683a0f698cc8/dvc/scm/git.py#L189
. Maybe you've force-commited a file in tmp? 🤔
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3561 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5AO57FI5B6PQIQQEPFLJDR6DT3XANCNFSM4LXO6HUA>
.
|
There's not much we can do in that case, unfortunately :( |
Is there any way to detect that it's been happening and make sure that the
.dvc .gitignore file doesn't contain duplicate entries? At least it could
correct for the duplicate /tmp entry writing behavior from dvc.
…On Thu, Jul 30, 2020 at 9:17 PM Ruslan Kuprieiev ***@***.***> wrote:
There's not much we can do in that case, unfortunately :(
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3561 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5AO52I5BNP7CLRX6KKNN3R6HBK5ANCNFSM4LXO6HUA>
.
|
@nickdelgrosso Sure, we could read the whole gitignore and check for duplicates in Line 212 in ed1c3a7
|
All good points. Yes, raising an error would probably be best. I
definitely didn't need that file in tmp, I just didn't realize that
its presence was a problem.
…On Fri, Jul 31, 2020 at 8:52 PM Ruslan Kuprieiev ***@***.***> wrote:
@nickdelgrosso <https://github.com/nickdelgrosso> Sure, we could read the
whole gitignore and check for duplicates in
https://github.com/iterative/dvc/blob/ed1c3a7a15d6101622a6d4ac708d9c548d6e1fd5/dvc/scm/git.py#L212
, though it might affect the perfomance a little bit (we do those gitignore
checks on every dvc run), but that's likely negligible. It would probably
be best to raise an error when we detect the duplicates, just to prevent
weird bugs, but there might potentially be scenarios where the user
really-really wants to git add some gitignored file. We could start by
raising an error though, seems like a good approach. Or do you still need
that file in tmp?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3561 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5AO555UVO2WUXGXMS4KO3R6MHHZANCNFSM4LXO6HUA>
.
|
@nickdelgrosso Created #4327 . Thanks! |
dvc version 0.91.1
installed via pip on ubuntu 18.04
Each dvc add produces extra line '/tmp' in .dvc/.gitignore.
The text was updated successfully, but these errors were encountered: