Skip to content

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 treeverse/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

None yet

Development

Successfully merging this pull request may close these issues.

dvc exp run: git-submodule destroys workspace

2 participants