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

showSignature = true messes with stats #52

Closed
wendelscardua opened this issue Dec 17, 2018 · 3 comments
Closed

showSignature = true messes with stats #52

wendelscardua opened this issue Dec 17, 2018 · 3 comments

Comments

@wendelscardua
Copy link

Expected behavior and actual behavior.

Expected: signature-related log text should be ignored by script
Actual: signature-related log text is parsed as if it was actual log text

Steps to reproduce the problem.

Enable on ~/.gitconfig:

[log]
    showSignature = true

List contributors sorted by name, on a repository with signed commits:

$ git quick-stats # and then select e.g. 7

Notes

There exists some git log command line switch for overriding of this flag - I don't remember which one, but another git-related project used it to avoid this problem.

@tomice
Copy link
Collaborator

tomice commented Jan 16, 2019

I believe this can be fixed by passing the -c flag to git and saying log.showSignature=false before the rest of the commands. For example, in function contributors(), we would change:
git log --use-mailmap --no-merges --no-show-signature $_since $_until --format='%aN' $_pathspec | sort -u | cat -n

to

git -c log.showSignature=false log --use-mailmap --no-merges --no-show-signature $_since $_until --format='%aN' $_pathspec | sort -u | cat -n

Unfortunately, I don't really have any repositories I work in that are signed, so I don't have a readily accessible way of testing to make sure this fix will work. If you have a moment, do you think you could test this and see if it is a possible fix? If it does work, I can create a pull request real quick to fix the issue. If it doesn't, I can try to investigate further.

@wendelscardua
Copy link
Author

@tomice it works!

tomice added a commit to tomice/git-quick-stats that referenced this issue Jan 16, 2019
* When someone has the showSignature=true flag set in their .gitconfig
  file, gpg verifying signature related text would be parsed as if it
  was actual log information. This change ignores signature-related text
  by passing the -c log.showSignature=false option to git so it ignores
  a user's custom .gitconfig showSignature flag regardless as to what it
  is set to.

Resolves: Issue arzzen#52
@arzzen
Copy link
Owner

arzzen commented Jan 17, 2019

Thanks @tomice and @wendelscardua, added in pull request #58

@arzzen arzzen closed this as completed Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants