Skip to content

dvc add ignore unprotected files that have not been modified #1655

@rmcavoy

Description

@rmcavoy

DVC version 0.29.0 installed via pip on Linux

Following the sequence of commands
dvc unprotect data.dat
(modify data.dat)
dvc add data.dat

Correctly replaces dvc.dat with the correct kind of file link
but
dvc unprotect data.dat
(not modifying)
dvc add data.dat

Causes add to skip data.dat because it is already cached and leaves the file on disk without linking. Presumably the ideal behavior is to have dvc add check what kind of link the cache should use and update the file to that link even if the file was not modified. This way modified and unmodified data have the same behavior.

Currently the workaround is to rm the data file and checkout which is somewhat awkward.

Metadata

Metadata

Assignees

Labels

enhancementEnhances DVCp2-mediumMedium priority, should be done, but less important

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions