Commit 37ad030
committed
minor #109 Fix GPG signed commits breaks parsing of commit messages (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 messagesFile tree
4 files changed
+33
-0
lines changed- src/Gitonomy/Git/Parser
- tests/Gitonomy/Git/Tests
4 files changed
+33
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
122 | 137 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
58 | 71 | | |
59 | 72 | | |
60 | 73 | | |
| |||
0 commit comments