NShiny
NShiny

Reputation: 1156

Unable to ignore .DS_Store files in DVC

I use DVC to track my media files. I use MacOS and I want".DS_Store" files to be ignored by DVC. According to DVC documentation I can achieve it with .dvcignore. I created .dvcignore file with ".DS_Store" rule. However every time ".DS_Store" is created dvc status still says that content has changed

Here is the little test to reproduce my issue:

$ git init
$ dvc init

# create directory to store data
# and track it's content with DVC
$ mkdir data
$ dvc add data

# Ignore .DS_Store files created by MacOS
$ echo ".DS_Store" > .dvcignore

# create .DS_Store in data dir
$ touch "data/.DS_Store"

If I understand DVC documentation correctly then dvc status should print something like "Pipeline is up to date. Nothing to reproduce". However dvc status gives me:

data.dvc:
        changed outs:
                modified:           data

How I can really ignore ".DS_Store" files?

UPDATE: The .dvcignore support noticeably improved in latest versions and the problem is no more relevant.

Upvotes: 3

Views: 548

Answers (2)

Jorge Orpinel Pérez
Jorge Orpinel Pérez

Reputation: 6627

It seems this has been since fixed/implemented!

$ dvc init --no-scm
...
$ mkdir data
$ dvc add data
WARNING: 'data' is empty.
Saving information to 'data.dvc'.                                                                                                                            
$ echo ".DS_Store" > .dvcignore
$ touch "data/.DS_Store"
$ tree -a data
data
└── .DS_Store

0 directories, 1 file
$ dvc status
Data and pipelines are up to date.

Upvotes: 2

Shcheklein
Shcheklein

Reputation: 6304

The current implementation of .dvcignore is very limited. Read more on it here.

Please, mention that you are interested in this feature here - https://github.com/iterative/dvc/issues/1876. That would help our team to prioritize issues properly.

The possible workaround for now would be to use one of these approaches - How to stop creating .DS_Store on Mac?

Upvotes: 3

Related Questions