Skip to content

repo: remind to git add only when using git #1693

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion dvc/repo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ def find_dvc_dir(root=None):
return os.path.join(root_dir, Repo.DVC_DIR)

def remind_to_git_add(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, @pared introduced remind_to_track method in https://github.com/iterative/dvc/pull/1673/files , so if scm is not git it simply won't do anything, so this change seems to be not needed anymore.

if not self.files_to_git_add:
is_git_repo = type(self.scm).__name__ == "Git"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check it by name? Maybe something like:
type(self.scm) is dvc.scm.Git?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uff, great one, @pared 👍


if not is_git_repo or not self.files_to_git_add:
return

logger.info(
Expand Down