-
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
SCM: allow multiple DVC repos inside single SCM repo #3257
Conversation
@dmpetrov I noticed that in #2706 you mentioned that managing subrepos from "master" repo might be a viable use case. In this issue, I introduced |
f65faf1
to
23ad958
Compare
23ad958
to
f5af1a1
Compare
|
f5af1a1
to
9ec5b28
Compare
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.
I've tested it a bit - looks good to me.
A couple comments are inline. The major one - if we need "subrepo" in config.
@pared No, commands should not go to nested repos. PS: we can even think about not supporting nested repos if it simplifies implementation or docs. |
d129803
to
a8aa91c
Compare
@dmpetrov ok, so in the end some kind of flag will have to be introduced to config (take note of this discussion: #3257 (comment)) I think we should go with the second option I mentioned there, which is introducing |
@pared Also something to note about no-scm, is that it will require changing our tests, because base |
9611ccb
to
386689e
Compare
f3e99bc
to
0928109
Compare
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.
All good from my end. Just a question above ^ Thanks
0393618
to
9ace861
Compare
@pared Looks good! How about docs though? Could you please create a doc PR before we merge this? |
39b3e1a
to
127b4c7
Compare
127b4c7
to
23f55ae
Compare
PR for docs: iterative/dvc.org#1022 |
class DvcIgnoreFilter(object): | ||
def __init__(self, tree): | ||
self.tree = tree | ||
self.ignores = {DvcIgnoreDirs([".git", ".hg", ".dvc"])} | ||
self.ignores = { | ||
DvcIgnoreDirs([".git", ".hg", ".dvc"]), |
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.
.hg ? Do we support Mercurial somehow now??? Or is this legacy stuff? Thanks
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.
We don't want to traverse through .git
or .hg
folders. People might use hg
for code versioning and use --no-scm
with DVC.
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.
Hm... Why only do this for .hg? There's many many possible files or dirs the user may want to gitignore and they can just add it to .gitignore/ or .git/info/exclude
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.
@jorgeorpinel add .hg
to .gitignore
? Maybe I'm missing something.
An alternative would be to add .hg
to .dvcignore
file, yes, but since we know about .hg
, we are skipping it automatically.
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.
add .hg to .gitignore?
Haha sorry I wasn't thinking right π
to add .hg to .dvcignore
Yeah, this! Since we don't support Mercurial in general why treat it specially? I'd let the user handle it, like he could want dvcignore any other files or directories for a bunch of reasons.
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.
DVC has --no-scm, so they could be using any version control out there
I don't think this is the case @skshetry. It's just kind of a legacy option name AFAIK. Refer to #2901.
Do people really use .hg folders for their work? Unless they do (which they shouldn't)
You'd be surprised.
Why shouldn't they? Will the directory name police pul them over? π
I realized that there might be indeed a stronger motivation to include more defaults
@shcheklein I don't even see this. DVC ignores .git/ automatically because it integrates with Git. I don't see a reason to treat any other file/dir name specially.
Your questions about .gitignore vs. .dvcignore are interesting though; I think there may be some issues already about that.
In summary, I vote to remove the 7 characters we're talking about, but I realize this is probably a moot point since no one even uses Mercurial anymore haha.
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.
@jorgeorpinel, I think something good thing to do is in middle. If people have a certain directories such as __pycache__
and venv
or similar kinds of directories, it'd be good to make them aware that .dvcignore
exists, at least a warning that traversing will be slow.
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.
Agree about improving .dvcignore awareness. (I think the warning may exist BTW?)
For docs, I opened iterative/dvc.org/issues/1033.
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.
at least a warning that traversing will be slow.
it's a really good idea. Please create an issue for this in the DVC core repo.
I still don't see a reason to include .hg
though. To my mind if we follow this logic it should be done properly like you described for example.
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.
Created #3436
β Have you followed the guidelines in the Contributing to DVC list?
π Check this box if this PR does not require documentation updates, or if it does and you have created a separate PR in dvc.org with such updates (or at least opened an issue about it in that repo). Please link below to your PR (or issue) in the dvc.org repo.
β Have you checked DeepSource, CodeClimate, and other sanity checks below? We consider their findings recommendatory and don't expect everything to be addressed. Please review them carefully and fix those that actually improve code or fix bugs.
Thank you for the contribution - we'll try to review it as soon as possible. π
Fixes #2349