-
Notifications
You must be signed in to change notification settings - Fork 84
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
gpg wrapper fails in git worktree #87
Comments
The issue seems to be due to buggy handling of the The funny thing is that /.../bitcoin/bitcoin-0.16$ python3
>>> import git
>>> git.Repo()
<git.Repo "/.../bitcoin/.git/worktrees/bitcoin-0.16">
>>> git.Repo('/.../bitcoin/bitcoin-0.16')
<git.Repo "/.../bitcoin/.git/worktrees/bitcoin-0.16">
>>> git.Repo('/.../bitcoin/.git/worktrees/bitcoin-0.16')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/.../.local/lib/python3.5/site-packages/git/repo/base.py", line 169, in __init__
raise InvalidGitRepositoryError(epath)
git.exc.InvalidGitRepositoryError: /.../bitcoin/.git/worktrees/bitcoin-0.16 However, it looks like that when calling the gpg program, git itself (I think) has set Edit: Okay, apparently worktrees are explicitly unsupported upstream, that's interesting gitpython-developers/GitPython#344 |
Bah:
I wonder if there's an alternative we could use instead? Worktrees are a cool and useful feature. |
I wonder, too. Haven't looked yet into how much work it would be to add worktree support, or whether there are alternatives to GitPython that do. Or whether it's possible to temporarily work around this at the I use worktrees for building and merging into version branches. So for the last few merges on 0.16 I had to disable the wrapper. Which is pretty lousy. For signing the |
Heh, looks like Rust's git2 crate has worktree support, so maybe I can just rewrite it all in rust. :) The git commit signing code shouldn't care about what branch it is, so all we really have to do is have a hack to figure out where the git directory is. Specifically, that hack would need to be added to
and in that directory there's another file,
|
Apparently this was fixed upstream for a while, |
The simplest way to get the real directory seems to be |
When using the gpg wrapper in a git worktree (out-of-tree checkout), the following error happens when signing:
I think this is a problem with the upstream
git
python module.The text was updated successfully, but these errors were encountered: