-
-
Notifications
You must be signed in to change notification settings - Fork 72
Fix GPG signed commits breaks parsing of commit messages #109
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
Conversation
Anything else I can do to move this forward? |
Looks like the tests are breaking, @stojg? |
Created a PR for the signed commit in the foobar repo gitonomy/foobar#1 |
I just merged your PR thanks. |
Bump :) |
Closed and reopened to trigger the travis tests |
Green ticks, yay. |
yay |
@lyrixx would you please be able to review this, now that the tests are passing? |
Good catch, thanks @stojg. |
…stojg) This PR was merged into the 1.0-dev branch. Discussion ---------- Fix GPG signed commits breaks parsing of commit messages If commits are [signed gpg](https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work) they will break the parsing of the log message since it's expecting two newlines after the commiter date where in the case of a GPG signature is added: Example commit: ``` commit e1a83f16ed61ae3807e5652c7ef894692c813513 tree 90908bdccbb0b9c42fdb6225d5aa47d7c66c3d22 parent 583811146f79f1bf6e167d54b276e21553512d1a author Stig Lindqvist <[email protected]> 1461274840 +1200 committer Stig Lindqvist <[email protected]> 1461274840 +1200 gpgsig -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJXGUjZAAoJEF7kfUZDyWQIaUkIAMYsSKA2C3XOQ2x0Ig3zOF5Y DV1YlSWa2ILy/V49U55CWMP/Atbr1bKpREMI9y1T9tBwsMV1gtqYk+JwqyCntTjD iaFexti++AZv47YrQa4aBtW18hRJp/BFrLjhkGnydHLvK1QJ2EAhIuqwRYiMHS8m mX3ChT1Quk5yZFumpPduGqwdNVWDxCssNMA6MKjn/gBWV1PUbsZWN2a9I54v7xfR ujKvzqwsnkKhOC4+0sQM25sw0AHj2/pqhAmB7tW+mjcUBY911ym7f1SvAMdrdMHm S5AJ0RkrntFqUA1Ydc6om+zUCSB8ztuNbD4JK5YrqukEy2ooyehWs8qc1NNLVLQ= =4KdG -----END PGP SIGNATURE----- signed commit ``` This PR is the quick solution by consuming the GPGSig (if it exists) and then throw it away. I added a test for this, but had to use my own [fork to create a signed commit](https://github.com/stojg/foobar/commit/e1a83f16ed61ae3807e5652c7ef894692c813513), so the tests will obviously fail unless the AbstractTest Repo is changed to `const REPOSITORY_URL = 'http://github.com/stojg/foobar.git';` This should fix #108 Commits ------- ab21ff6 Fix GPG signed commits breaks parsing of commit messages
Released as v1.0.1 |
Yay thanks @lyrixx ! |
Excellent, thanks a lot. Unfortunately I missed another case where signed commits break gitlib. Sorry for not finding it earlier :/ #110 I've tried to search for other parser that might be broken, but couldn't find any other that actually parses the commit message. |
…essage (stojg) This PR was merged into the 1.0-dev branch. Discussion ---------- Fix GPG signed commits will break on reading full commit message Ensure that we can get the full message when the commit has been GPG signed Follow up on #109 that only deals with the "log" part, this ensure that we can also return the message. Commits ------- 02de6db Fix GPG signed commits will break on reading full commit message
If commits are signed gpg they will break the parsing of the log message since it's expecting two newlines after the commiter date where in the case of a GPG signature is added:
Example commit:
This PR is the quick solution by consuming the GPGSig (if it exists) and then throw it away.
I added a test for this, but had to use my own fork to create a signed commit, so the tests will obviously fail unless the AbstractTest Repo is changed to
const REPOSITORY_URL = 'http://github.com/stojg/foobar.git';
This should fix #108