You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think this is really a bug, but maybe missing in documentation? Let me know what you think!
The short explanation is that, when you use the gemfile option on overcommit.yml and you pull some changes including an updated Gemfile.lock, the post-checkout git-hook may fail unless you run bundle install. This leaves the user on a detached HEAD state when trying to rebase their branch with the more up-to-date branch (as the running rebase will trigger the post-checkout hook too).
This has been causing much friction in my current team, as we're currently using overcommit's master branch because of this patch (may I also take the opportunity to ask for a patch version bump? 😄). We have some internal gems that are constantly updated and therefore Gemfile.lock is updated a couple dozen times every week.
When I checkout to overcommit-test and try to rebase it with the main branch, I get an error and the rebase fail halfway through (notice at the end the git is at detached HEAD state - indicating a failure halfway the rebase):
(main) $ git checkout overcommit-test
(overcommit-test) $ git rebase main
Note: switching to '3ec8664c0d96c0b0b374c7422816173c6ce22171'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 3ec8664 Second commit
Problem loading 'Gemfile': Could not find rake-13.0.6 in any of the sources
Try running:
bundle install --gemfile=Gemfile
error: could not detach HEAD
(3ec8664) $
The text was updated successfully, but these errors were encountered:
Drowze
changed the title
Hooks fail a lot when using gemfile: option and working with a team that frequently updates the Gemfile.lock
post-checkout frequently crashe rebasing when using gemfile: option and working with a team that frequently updates the Gemfile.lock
Aug 6, 2021
Drowze
changed the title
post-checkout frequently crashe rebasing when using gemfile: option and working with a team that frequently updates the Gemfile.lock
post-checkout frequently crashes a rebase when using gemfile: option and working with a team that frequently updates the Gemfile.lock
Aug 6, 2021
Drowze
changed the title
post-checkout frequently crashes a rebase when using gemfile: option and working with a team that frequently updates the Gemfile.lockgemfile: option causes post-checkout to frequently crash a rebase when working with a team that frequently updates the Gemfile.lock
Aug 6, 2021
I don't think this is really a bug, but maybe missing in documentation? Let me know what you think!
The short explanation is that, when you use the
gemfile
option onovercommit.yml
and you pull some changes including an updated Gemfile.lock, the post-checkout git-hook may fail unless you runbundle install
. This leaves the user on a detached HEAD state when trying to rebase their branch with the more up-to-date branch (as the running rebase will trigger thepost-checkout
hook too).This has been causing much friction in my current team, as we're currently using overcommit's
master
branch because of this patch (may I also take the opportunity to ask for a patch version bump? 😄). We have some internal gems that are constantly updated and thereforeGemfile.lock
is updated a couple dozen times every week.Long version with in-depth reproducible example:
overcommit-test
and try to rebase it with the main branch, I get an error and the rebase fail halfway through (notice at the end the git is atdetached HEAD
state - indicating a failure halfway the rebase):The text was updated successfully, but these errors were encountered: