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

import: \r\n line endings in DVC-file (Win) #3679

Closed
jorgeorpinel opened this issue Apr 25, 2020 · 3 comments
Closed

import: \r\n line endings in DVC-file (Win) #3679

jorgeorpinel opened this issue Apr 25, 2020 · 3 comments
Labels
awaiting response we are waiting for your reply, please respond! :)

Comments

@jorgeorpinel
Copy link
Contributor

jorgeorpinel commented Apr 25, 2020

λ dvc version
DVC version: 0.93.0
Python version: 3.7.5
Platform: Windows-10-10.0.18362-SP0
Binary: True
Package: exe
Supported remotes: azure, gdrive, gs, hdfs, http, https, s3, ssh, oss
Cache: reflink - not supported, hardlink - supported, symlink - not supported
Filesystem type (cache directory): ('NTFS', 'C:\\')
Repo: dvc, git
Filesystem type (workspace): ('NTFS', 'C:\\')

λ dvc import https://github.com/iterative/dataset-registry \
>              get-started/data.xml -o data/data.xml
Importing 'get-started/data.xml (https://github.com/iterative/dataset-registry)' -> 'data\data.xml'

I discovered that the resulting data/data.xml.dvc has^M at line endings when using git diff. I'm using Git Bash (on Cmder)

dvc import is the only command that I've noticed does this, so far. I guess either make sure all commands use UNIX-style line endings, or introduce a config option for this, by default auto-detecting the system if possible. Something like git config core.autocrlf.

@jorgeorpinel jorgeorpinel added the bug Did we break something? label Apr 25, 2020
@jorgeorpinel jorgeorpinel changed the title import: \r\n line ending in import stage import: \r\n line ending in DVC-file Apr 25, 2020
@jorgeorpinel jorgeorpinel changed the title import: \r\n line ending in DVC-file import: \r\n line endingd in DVC-file (Win) Apr 25, 2020
@jorgeorpinel jorgeorpinel changed the title import: \r\n line endingd in DVC-file (Win) import: \r\n line endings in DVC-file (Win) Apr 25, 2020
@efiop
Copy link
Contributor

efiop commented Apr 25, 2020

@jorgeorpinel So on windows we use CRLF? That is alright for newly generated files. When you git add them, git will take care of that. It also has a config option for that. There is nothing we need to do on DVC side, we just comply with the OS conventions that we are running on.

@efiop efiop added awaiting response we are waiting for your reply, please respond! :) and removed bug Did we break something? labels Apr 25, 2020
@jorgeorpinel
Copy link
Contributor Author

Hmmm. I don't think the DVC-file I created earlier with dvc add has CRLF... I need to double check. Maybe Git just removed them, like you mentioned ⏳

@jorgeorpinel
Copy link
Contributor Author

I can confirm that the file always had CRLF line terminations from the beginning when I created it. Even after committed, this was preserved. For some reason git diff thinks that the committed file does not use CRLF which seems wrong to me... But it's not a DVC issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response we are waiting for your reply, please respond! :)
Projects
None yet
Development

No branches or pull requests

2 participants