question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

use git index to see force-added files

See original GitHub issue

We’ve received a few reports about people getting confused by dvc pull/etc not detecting their dvc files in configuration with such .gitignore:

/data
!**/*.dvc

as explained by @pmrowla , this is just a nonobvious git behavior and a workaround is:

/data/**
!/data/**/
!/data/**/*.dvc

But dvc list will see those files no problem, because it doesn’t seem to use is_ignore (needs confimation), thus, we should use git index locally as well to detect force-added files even if they are gitignored.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
karajan1001commented, Jul 6, 2021

I think this is enough.

/data/**
!**/*.dvc
1reaction
efiopcommented, Jul 8, 2021

@SebbanSms deps only declare dependencies for that particular stage, they don’t really do data management. Plus, same path could be declared as a dependency in multiple stages/dvc.yaml’s , which is a bit problematic for us right now in terms of mapping of versions (aka md5s), while outs are unique and don’t have that problem. We might reconsider this in the future though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git - git-show-index Documentation
The objects are output in the order in which they are found in the index file, which should be (in a correctly constructed...
Read more >
Understanding Git — Index
Instead, git has a file called the index that it uses to keep track of the file changes over the three areas: working...
Read more >
What does the git index contain EXACTLY?
The index is a binary file (generally kept in .git/index ) containing a sorted list of path names, each with permissions and the...
Read more >
MergeConflictHandler must use `git add -f` to ignore .gitignore
Defines whether conflicted files should be added to the index using git add --force, during automatic merges. By # default, this behaviour is...
Read more >
The Git index and Recovering Files
When I git add a file, it will add that file to the object database ... my staging area using the git ls-files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found