Skip to content
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

Build fails if git config log.showSignature true #86

Closed
RussKie opened this issue Dec 1, 2018 · 2 comments · Fixed by #102
Closed

Build fails if git config log.showSignature true #86

RussKie opened this issue Dec 1, 2018 · 2 comments · Fixed by #102

Comments

@RussKie
Copy link

RussKie commented Dec 1, 2018

All of a sudden my project failed to build with the following error:

0>------- Project started: xxx
0>C:\Users\xxx\.nuget\packages\gitinfo\2.0.18\build\GitInfo.targets(652,3): Warning MSB3073: The command "git rev-list --count "8cbcd2b25223c73fbe9f7dad08e498cf82734bfa".."gpg: keyblock resource '/c/xxx/xxx/C:\Users\xxx\.gnupg/pubring.kbx': No such file or directory;gpg: Signature made Sat Dec  1 04:02:52 2018 AUSEST;gpg:                using RSA key 4AEE18F83AFDEB23;gpg: Can't check signature: No public key;33015f037"" exited with code 129.
0>C:\Users\xxx\.nuget\packages\gitinfo\2.0.18\build\GitInfo.targets(664,3): Warning: Failed to retrieve commit count from tag 'v3.00.00-rc2' to tip gpg: keyblock resource '/c/xxx/xxx/C:\Users\xxx\.gnupg/pubring.kbx': No such file or directory;gpg: Signature made Sat Dec  1 04:02:52 2018 AUSEST;gpg:                using RSA key 4AEE18F83AFDEB23;gpg: Can't check signature: No public key;33015f037. Defaulting to zero commits.
0>obj\Debug\ThisAssembly.GitInfo.g.cs(45,86): Error CS1009: Unrecognized escape sequence
0>obj\Debug\ThisAssembly.GitInfo.g.cs(45,100): Error CS1009: Unrecognized escape sequence
0>obj\Debug\ThisAssembly.GitInfo.g.cs(48,83): Error CS1009: Unrecognized escape sequence
0>obj\Debug\ThisAssembly.GitInfo.g.cs(48,97): Error CS1009: Unrecognized escape sequence
0>------- Project finished: xxx. Succeeded: False. Errors: 4. Warnings: 2
Build completed in 00:00:03.193

Obviously when solution is compiled, GitInfo emits incorrect info.
\obj\Debug\GitInfo.cache:

GitBranch=test1;
GitCommit=gpg: keyblock resource '/c/xxx/xxx/C:\Users\xxx\.gnupg/pubring.kbx': No such file or directory;gpg: Signature made Sat Dec  1 04:02:52 2018 AUSEST;gpg:                using RSA key 4AEE18F83AFDEB23;gpg: Can't check signature: No public key;33015f037;
GitSha=gpg: keyblock resource '/c/xxx/xxx/C:\Users\xxx\.gnupg/pubring.kbx': No such file or directory;gpg: Signature made Sat Dec  1 04:02:52 2018 AUSEST;gpg:                using RSA key 4AEE18F83AFDEB23;gpg: Can't check signature: No public key;33015f03791b2441e3b5f997cc33a72af4862f11;
GitBaseVersion=3.00.00-rc2;
GitBaseVersionSource=GitBaseTag;
GitBaseVersionMajor=3;
GitBaseVersionMinor=00;
GitBaseVersionPatch=00;
GitCommits=0;
GitTag=v3.00.00-rc2-92-g33015f037;
GitBaseTag=v3.00.00-rc2;
GitSemVerMajor=3;
GitSemVerMinor=00;
GitSemVerPatch=0;
GitSemVerLabel=rc2;
GitSemVerDashLabel=-rc2;
GitSemVerSource=Tag

Running the git log command in bash produces the following result:

xxxx@xxxx MINGW64 /c/xxx/xxx (test1)
$ git log -n 1
commit 33015f03791b2441e3b5f997cc33a72af4862f11 (HEAD -> test1, remote/release/3.00, release/3.00)
gpg: keyblock resource '/c/xxx/xxx/C:\Users\xxx\.gnupg/pubring.kbx': No such file or directory
gpg: Signature made  1 Dec 2018  4:02:52 am AUSEST
gpg:                using RSA key 4AEE18F83AFDEB23
gpg: Can't check signature: No public key
Merge: aebb02431 83e8640f6
Author: XXX <xxxx@xxx.com>
Date:   Fri Nov 30 18:02:52 2018 +0100

    Merge pull request #5821 from xxx/feature/5811

    Fixed #5811: strange resize of the description column when selecting lines with mouse click

When git config log.showSignature false, the correct info is emitted:

GitBranch=test1;
GitCommit=33015f037;
GitSha=33015f03791b2441e3b5f997cc33a72af4862f11;
GitBaseVersion=3.00.00-rc2;
GitBaseVersionSource=GitBaseTag;
GitBaseVersionMajor=3;
GitBaseVersionMinor=00;
GitBaseVersionPatch=00;
GitCommits=92;
GitTag=v3.00.00-rc2-92-g33015f037;
GitBaseTag=v3.00.00-rc2;
GitSemVerMajor=3;
GitSemVerMinor=00;
GitSemVerPatch=92;
GitSemVerLabel=rc2;
GitSemVerDashLabel=-rc2;
GitSemVerSource=Tag

Expected:
I think you should set git config log.showSignature false (if it is set to true) when you're gathering information, and restore it back, when done.

RussKie added a commit to gitextensions/gitextensions that referenced this issue Dec 1, 2018
* Assume files in which we inject the build number as "unchanged"
* Ensure no other files have changed
* Mitigate build failures due to invalid gpg signatures, a workaround
for devlooped/GitInfo#86

Closes #5698
RussKie added a commit to gitextensions/gitextensions that referenced this issue Dec 1, 2018
* Assume files in which we inject the build number as "unchanged"
* Ensure no other files have changed
* Mitigate build failures due to invalid gpg signatures, a workaround
for devlooped/GitInfo#86

Closes #5698
@drewnoakes
Copy link

I think you should set git config log.showSignature false (if it is set to true) when you're gathering information, and restore it back, when done.

Or use:

git -c log.showSignature=false log -n 1

kzu added a commit that referenced this issue Oct 15, 2019
@kzu kzu closed this as completed in #102 Oct 15, 2019
kzu added a commit that referenced this issue Oct 15, 2019
@kzu
Copy link
Member

kzu commented Oct 15, 2019

Thanks for reporting and suggesting a clean fix!

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

Successfully merging a pull request may close this issue.

3 participants