Skip to content
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

Add support for working with git-worktree #336

Closed
egh opened this issue Feb 10, 2016 · 4 comments
Closed

Add support for working with git-worktree #336

egh opened this issue Feb 10, 2016 · 4 comments

Comments

@egh
Copy link

egh commented Feb 10, 2016

Steps to reproduce:

git init foo && cd foo
echo "gem 'overcommit'" > Gemfile
bundle install
overcommit
overcommit --sign
git add Gemfile* .overcommit.yml 
git commit -a -m 'init'
git worktree add ../foo-a

Expected behavior: no error.

Actual behavior (after running git worktree add ../foo-a):

Enter ../foo-a (identifier foo-a)
Switched to a new branch 'foo-a'
No such file or directory @ rb_file_s_size - /home/egh/foo/.git/worktrees/foo-a/hooks/overcommit-hook
/home/egh/.rbenv/versions/2.2.3/lib/ruby/2.2.0/fileutils.rb:815:in `size'
/home/egh/.rbenv/versions/2.2.3/lib/ruby/2.2.0/fileutils.rb:815:in `compare_file'
/home/egh/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/overcommit-0.31.0/lib/overcommit/installer.rb:54:in `update'
/home/egh/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/overcommit-0.31.0/lib/overcommit/installer.rb:20:in `run'
/home/egh/foo/.git/hooks/post-checkout:67:in `<main>'
Report this bug at https://github.com/brigade/overcommit/issues

Environment:
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
overcommit: 0.31.0
git version 2.5.0
os: GNU/Linux, Ubuntu 15.10

@sds sds changed the title Overcommit does not work with git-worktree Add support for working with git-worktree Feb 11, 2016
@sds
Copy link
Owner

sds commented Feb 11, 2016

Hey @egh, thanks for the report.

git-worktree didn't exist (i.e. Git 2.5 hadn't been released) when Overcommit was first created. I haven't had much opportunity to personally play around with the feature as my primary professional development environment is still on Git 1.8.3.1 (CentOS 7). Thus I'm not sure how much work it would take to add support for it to Overcommit (it may not be much).

Having said that, I would love to merge a pull request adding support!

@sds
Copy link
Owner

sds commented Feb 11, 2016

For now, I've added a note to the README about the lack of support for git-worktree.

@egh
Copy link
Author

egh commented Feb 11, 2016

Unfortunately, I don't even use git-worktree - I was just trying it out. I assume the fix would be easy, but I don't know overcommit of git-worktree, so I'm not sure I'll have the time to fix it. Thanks for the README note!

@sds
Copy link
Owner

sds commented Feb 18, 2018

Implemented in #559

@sds sds closed this as completed Feb 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants