Skip to content

dulwich: do not add files from submodules #431

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

Merged
merged 2 commits into from
Aug 6, 2025
Merged

dulwich: do not add files from submodules #431

merged 2 commits into from
Aug 6, 2025

Conversation

skshetry
Copy link
Collaborator

git doesn't add files from submodules when staging, so we align dulwich with that behavior.

Also, libgit2/pygit2 removes files from submodules on reset(), so raise NotImplementedError for now to avoid accidental deletions, and redirect such cases to the GitPython backend instead.

Fixes iterative/dvc#10823.

@skshetry skshetry changed the title dulwich: do not add from submodules dulwich: do not add files from submodules Jul 31, 2025
@skshetry skshetry added this to DVC Jul 31, 2025
@github-project-automation github-project-automation bot moved this to Backlog in DVC Jul 31, 2025
@skshetry skshetry moved this from Backlog to Review In Progress in DVC Jul 31, 2025
@skshetry skshetry self-assigned this Jul 31, 2025
Also implement `list_submodules()` to get a list of submodules in the repo,
and raise `NotImplementedError` in `pygit2` for `reset()`, as libgit2
removes files from submodules on reset.
@skshetry skshetry merged commit fb6e0b4 into main Aug 6, 2025
17 checks passed
@skshetry skshetry deleted the submodules-add branch August 6, 2025 14:44
@github-project-automation github-project-automation bot moved this from Review In Progress to Done in DVC Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

dvc exp run: git-submodule destroys workspace
2 participants