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?
to your account
pre-commit looks to find difference between remote and local branches as pre-commit wants to know the files changed. But in case of force, git correctly fails to generate diff.
Expected: pre-commit can run all the hooks that has pass-filename=false as they do not require diffs.
Thanks for the awesome stuff!
The text was updated successfully, but these errors were encountered:
I can't reproduce, please provide an example as force pushing is working fine for me
Sorry, something went wrong.
The forced push is on unrelated heads and so git cannot get the difference. Below is my output...
git.exe push -v --progress --force "github" master:main
Pushing to https://github.com/bogusfocused/ha_lan_smartthings.git
An unexpected error has occurred: CalledProcessError: command: ('C:\\Program Files\\Git\\mingw64\\libexec\\git-core
\\git.EXE', 'diff', '--name-only', '--no-ext-diff', '-z',
return code: 128
expected return code: 0
fatal: 8e9e6537d911cbfa8a88aa608c3afa893a340f8c...ced7786cd5098f321b48e9a1027cce4e8938cbbf: no merge base
Check the log at C:\Users\Rohit\.cache\pre-commit\pre-commit.log
error: failed to push some refs to 'https://github.com/bogusfocused/ha_lan_smartthings.git'
git did not exit cleanly (exit code 1) (1672 ms @ 8/9/2021 12:48:56 PM)
ah yeah if you're force pushing unrelated histories then that'll happen -- I'm not sure there's much that could be done in that case since it's really "push everything"
hmmm actually I still can't reproduce -- what version of git are you using?
Thanks. The fix works for me.
Successfully merging a pull request may close this issue.