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/get: inconsistent CRLF handling when importing git-tracked files in cross-platform projects #6058

Closed
pmrowla opened this issue May 25, 2021 · 0 comments
Labels
A: data-sync Related to dvc get/fetch/import/pull/push enhancement Enhances DVC p3-nice-to-have It should be done this or next sprint

Comments

@pmrowla
Copy link
Contributor

pmrowla commented May 25, 2021

From #6049 (comment)

When we dvc import or dvc get a git-tracked file, DVC will read/download (and then track) the file with whatever line endings are in the git-committed blob. Depending on a user's git core.autocrlf config, the line endings in the blob may not match what git puts in the user's workspace.

Typically when working in a cross-platform project, users will set autocrlf=true so that git checks out files with \r\n line endings in their windows workspace, but commits blobs with unix \n line endings. If you dvc import one of these git-tracked files, the resulting DVC-tracked file will always contain \n endings (even on Windows).

This causes potentially unexpected behavior where the user will end up with an imported version of the file which contains line endings that are inconsistent with what they would get from git checkout

We should consider handing line ending normalization on checkout for imported git-tracked files, so that after dvc checkout, the files have line endings which are consistent with git checkout

@pmrowla pmrowla added enhancement Enhances DVC p3-nice-to-have It should be done this or next sprint labels May 25, 2021
@daavoo daavoo added the A: data-sync Related to dvc get/fetch/import/pull/push label Mar 1, 2022
@mattseddon mattseddon closed this as not planned Won't fix, can't repro, duplicate, stale Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: data-sync Related to dvc get/fetch/import/pull/push enhancement Enhances DVC p3-nice-to-have It should be done this or next sprint
Projects
None yet
Development

No branches or pull requests

3 participants