-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
stage collection: do not collect .gitignored dvcfiles #5265
Conversation
8b680e1
to
ec7ffce
Compare
|
||
def is_ignored(path): | ||
# apply only for the local tree | ||
return is_local_tree and scm.is_ignored(path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check might not work everywhere, especially in for_write=True
scenarios in dvcx
. But as we are adjusting our APIs in ExternalRepo
, Repo.clone()
should set some kind of state to workaround that. And, we'll add additional check for repo.is_external
here and that should be enough.
I think users should be able to ignore lockfile. Dvc is able (to some extent) to work without it, so removing this possibility would limit |
One thing to keep in mind is that experiments runs in temp directories (and on remote machines in the future) have to git commit |
@pmrowla Fair point, I didn't consider experiments in my thought process. In that case it might be better to just require it. |
6f64d91
to
1661726
Compare
Closes #5244
A few fixes has been made along the way, including:
An open question is, what should we do about lockfiles if they are git-ignored or dvc-ignored?
Right now, we assume the lockfile as empty if they are dvc-ignored and we don't care about git-ignores
for the lockfiles. I feel that this behaviour is good, but if we want them to be consistent, please do tell me.
Another thing to keep in mind is, since the implementation depends on
isinstance(repo.tree, LocalTree)
, if we start using LocalTree forget/list/import
, it'll break, though I don't think it should as we better apply it to only the user's workspace (IIRCdvcx
uses this mode).Though, this might be handled by a state (eg:
repo.is_external_repo
or something like that).❗ I have followed the Contributing to DVC checklist.
📖 If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here.
Thank you for the contribution - we'll try to review it as soon as possible. 🙏