Skip to content

Signed commits not parsed correctly #132

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

Closed
ArnoVanLumig opened this issue Jan 11, 2014 · 1 comment
Closed

Signed commits not parsed correctly #132

ArnoVanLumig opened this issue Jan 11, 2014 · 1 comment
Milestone

Comments

@ArnoVanLumig
Copy link

The _deserialize method of the Commit object (objects/commit.py:407) doesn't handle signed commits properly, see this example of a raw formatted git commit object (taken from the rails repository, where I discovered this bug):

commit 31735bd39127784019893e4860b2c9807293da25
tree 9c028a6346b49abfed31d8927d47980994f3b73d
parent 1f633c78ea7ff13a8f35d64e8172b774dd662667
author Miguel Herranz <[email protected]> 1345231220 +0200
committer Miguel Herranz <[email protected]> 1345231220 +0200
gpgsig -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (Darwin)

 iQIcBAABAgAGBQJQLpm/AAoJEJPQ5hNIfbMZ5KAP/2lFh7WMNR8c1tyQOXW518/k
 92mr1YsdD4dSePLflKvloZe6ITfb6btcSd/nAnbdBubRiuqlpCGSmMUzZrafNXpF
 WD5zAPQude75KJl3Rar6nBCLzpNm4a3sAQdLvDLgjCA823+qAzLbk7xWCt+0oaal
 qJK5SJDwtyF+PXS8T+WPhuIERjNE3CkPG7NCFR4Atg1aiSMBkfY35FS0JpSXNqW0
 VZcHjAZR8oC7YuipwkoEKatjC/lwQfRKM+LdI2qP/1f05EVJaDAZGpQShyrVNgLt
 hlaZLL880XyNdzuP986J19RbuG69+GWbL2Q0DZItrxbUo7JqDes0uIDh/c2xlwDt
 QFISJ9Xieogo2FKDIFD2rc8jiHYiMx3OUs6QOTz6YXfAUdEoVInrv32Tm0E+IiHq
 Y5xxlBiNOsHd448Om6cB7sliwbdc5ic9UYrWibqgzEjdiyoY3uRnyS6r19ISjod+
 +C5aYZr3uWz7xzW6hY+VWi9pM9xxkdYZEN1vBiGrm3hH9b2cm9M1roRrMoCz0Kjy
 xgZSSnp+Dft2Sw61DJHxf7t8oaOW7J7ZWjkD6mM66Kx7IpKzvzfReSYjLQtQNcNt
 8NHVUySPkC3/gpdlyzGOSu0xRvH1eq2eBJrKetlNN9XAEZAutQ+symdmfNY7L/Mj
 JcwMU0pcsI9X8NXBUMoK
 =GOBp
 -----END PGP SIGNATURE-----

    Update to activerecord-deprecated_finders on generator

As you see there may be a gpgsig line after the committer which is then followed by the actual signature. GitPython doesn't recognise this and will interpret it as the encoding line. The enc variable is then set to '-----BEGIN PGP SIGNATURE-----', which is of course not valid and will cause an exception on line 443.

To reproduce the problem first clone the rails repository, and then run this code:

from git import *
repo = Repo("../rails")
repo.commit("31735bd39127784019893e4860b2c9807293da25").author
@Byron Byron added this to the v0.3.2 milestone Nov 19, 2014
@Byron
Copy link
Member

Byron commented Nov 19, 2014

PGP signature parsing was implemented in 0.3.2 - please consider upgrading git-python and retry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants