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
Destructive operation on submodules with submodule.recurse = true
git setting
#2063
Comments
there's a test in our testsuite which shows this works correctly -- do you have more information on how to reproduce this? looking at your output it looks like your submodules may have already been broken since your report is also incomplete -- you have not shared the command you ran and its output so I cannot help you further without that |
also, do you have any |
There was definitively a problem with them, but the changes to these submodules date from months back, there's around 20 commits following those changes.
From the history, it was a simple
None. |
without a reproduction there isn't really much I can fix here :( -- the operations run are supposed to be safe (especially because |
ahah -- is it possible you have this setting enabled? https://git-scm.com/docs/git-config#Documentation/git-config.txt-submodulerecurse let me see if that's what can cause this ? |
Well, apparently the last sysadmin decided to put it in the config, and I ended getting it too after rsyncking the repo from his account... $ git config --list --show-origin | rg recurse
file:.git/config submodule.recurse=true |
rough! well I'll at least be able to fix that by ignoring that setting for pre-commit's programmatic uses of git |
submodule.recurse = true
git setting
So if I understand well, having |
|
Well, submodules were always like a weird git workaround to a difficult problem (I think) and not very though out... |
describe your issue
I added pre-commit to an ansible playbook repository that does extensive usage of git submodules for roles.
I had two submodules with extensive changes:
Upon doing a commit I received an error (check ~/.cache/pre-commit/pre-commit.log section) due to having some problems in my repo and its submodules.
Notice that I cold not even run
git status
afterwards:After fixing the problems:
and running
git apply
to have my changes back:I noticed that my two submodules now had no changes in them...
And unfortunately I see nothing in pre-commit cache area to help me recover them.
pre-commit --version
pre-commit 2.15.0
.pre-commit-config.yaml
~/.cache/pre-commit/pre-commit.log (if present)
version information
error information
The text was updated successfully, but these errors were encountered: