import/get: inconsistent CRLF handling when importing git-tracked files in cross-platform projects #6058
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
From #6049 (comment)
When we
dvc import
ordvc 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 gitcore.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 youdvc 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 withgit checkout
The text was updated successfully, but these errors were encountered: