Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GPG signature support on commit object.#57

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

sugi
Copy link
Contributor

@sugisugi commentedMay 6, 2012

Current version fails if any commit object has GPG signeture.

It works by just deleting lines from 433 to 440 of git/objects/commit.py.

I can't find documentation of git object format. But I tried to write support
GPG signature on commit object.

Please consider to merge.

Here is the way to reproduce problem:

sugi@vaj-k-334-sugi:~% mkdir signed-testsugi@vaj-k-334-sugi:~% cd  signed-testsugi@vaj-k-334-sugi:~/signed-tes/% git initInitialized empty Git repository in /home/sugi/signed-test/.git/git@vaj-k-334-sugi:~/signed-test% date > date.txtsugi@vaj-k-334-sugi:~/signed-test% git add .sugi@vaj-k-334-sugi:~/signed-test% git commit -S -m 'Test commit with GPG sig.'You need a passphrase to unlock the secret key foruser: "Tatsuki Sugiura <sugi@nemui.org>"1024-bit DSA key, ID 4502FDC2, created 2000-09-30gpg: gpg-agent is not available in this session[master (root-commit) afad9ad] Test commit with GPG sig. 1 file changed, 1 insertion(+) create mode 100644 date.txtsugi@vaj-k-334-sugi:~/signed-test% git cat-file commit HEADtree 9165a13698f6b211db3d9631958ef11e8d06d477author Tatsuki Sugiura <sugi@nemui.org> 1336266773 +0900committer Tatsuki Sugiura <sugi@nemui.org> 1336266773 +0900gpgsig -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEABECAAYFAk+l0BUACgkQbK2FzkUC/cLR9wCeKUkjeA39+vy0T/TwJuqPhca3 eNMAnRw0tDNAqIcM4HJnHvzCsu86dLGV =ZlAu -----END PGP SIGNATURE-----Test commit with GPG sig.sugi@vaj-k-334-sugi:~/signed-test% python    Python 2.7.3rc2 (default, Apr 22 2012, 22:35:38) [GCC 4.6.3] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> import git>>> git = git.Repo("/home/sugi/signed-test")>>> git.commit()<git.Commit "afad9ad7986c98784288ae71deb696d505cdfe5c">>>> git.commit().authorafad9ad7986c98784288ae71deb696d505cdfe5cTraceback (most recent call last):  File "<stdin>", line 1, in <module>  File "/home/sugi/lib/python2.7/site-packages/gitdb-0.5.4-py2.7-linux-x86_64.egg/gitdb/util.py", line 238, in __getattr__    self._set_cache_(attr)  File "/home/sugi/lib/python2.7/site-packages/GitPython-0.3.2.RC1-py2.7.egg/git/objects/commit.py", line 133, in _set_cache_    self._deserialize(StringIO(stream.read()))  File "/home/sugi/lib/python2.7/site-packages/GitPython-0.3.2.RC1-py2.7.egg/git/objects/commit.py", line 444, in _deserialize    self.author.name = self.author.name.decode(self.encoding) LookupError: unknown encoding: -----BEGIN PGP SIGNATURE-----

@Byron
Copy link
Member

Hi Sugi,

Thanks for discovering and fixing the issue. It would be great if you could add a test to verify it truly works.

Thanks,
Sebastian

@sugi
Copy link
ContributorAuthor

sugi commentedMay 8, 2012

Thank you for your reply!

OK. I'd like to write test. But I need time.

@kisoku
Copy link

We've encountered the exact same issue where I work. Our fix is also identical, we're still in the process of testing the patch. +1 on this pull request.

@sugi
Copy link
ContributorAuthor

sugi commentedOct 7, 2013

I rewrite this patch and sent new pull request against current master as#124.
Please continue to review new one.

@sugisugi closed thisOct 7, 2013
gak added a commit to gak/GitPython that referenced this pull requestDec 31, 2013
… applied to 0.3.Without it, the following error happens:LookupError: unknown encoding: -----BEGIN PGP SIGNATURE-----I Couldn't cherry pick. Git went spaz. The original author is@sugiand the commit is from sugi/GitPython:8065d2a
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@sugi@Byron@kisoku@ignatenkobrain

[8]ページ先頭

©2009-2025 Movatter.jp