mergestat-lite icon indicating copy to clipboard operation
mergestat-lite copied to clipboard

author_email null

Open b4ldr opened this issue 2 years ago • 3 comments

Hi,

i was trying to export data using the following command

$ mergestat export puppet-mergestat.sqlit \
 -e blame \
 -e "SELECT files.path, blame.line_no, commits.hash, commits.author_email FROM files, blame('', '', files.path) JOIN commits ON commits.hash = blame.commit_hash" \
 -r git/puppet

however i noticed that for many of the entries the author_email field is null. The following is a specific example of a query that returns a null author_email

$ mergestat "select author_email from commits('https://github.com/wikimedia/puppet') where hash = 'ecd5036b430abafd88ef26dd43b257b8e5187d29'"

From the raw commit I can see that the email address is present. Am i missing something or is this perhaps a bug?

Thanks

b4ldr avatar Jun 27 '22 11:06 b4ldr

Hi @b4ldr thanks for bringing this up - this looks like a bug. I was able to reproduce your issue (null author_email on that specific commit in your repo - when it in fact should have an email).

On first pass, it seems to be a bug in how we're handling .mailmap files, as adding the --skip-mailmap seems to "solve" the issue (an email now appears when I execute the same query).

I will mark this as a bug and find time to investigate what's going on. Thanks for submitting. In the meantime, is adding the --skip-mailmap flag sufficient to unblock your use case? That will tell mergestat not to apply email mappings found in a .mailmap file, and just display what's stored in the commit

patrickdevivo avatar Jun 27 '22 14:06 patrickdevivo

@patrickdevivo thanks for the quick response, ill re-generate the export tonight (it takes a few hours) and let you know and please let me know if you would like me to do any other testing

b4ldr avatar Jun 27 '22 15:06 b4ldr

@patrickdevivo sorry for the delay, confirming that adding --skip-mailmap solves the issue for me

b4ldr avatar Jul 11 '22 16:07 b4ldr

I'm running into this issue with the summarize command too.

Did a brew install mergestat and ran the following in my local git repo.

➜ mergestat summarize commits --skip-mailmap
➜ ERR sql: Scan error on column index 1, name "author_email": converting NULL to string is unsupported

chrjohannesen avatar Jan 13 '23 22:01 chrjohannesen

Any updates on this issue?

esmiralha avatar May 19 '23 16:05 esmiralha

This PR addresses this issue and has just been released in the latest version 0.6.1 of mergestat-lite!

amenowanna avatar May 22 '23 19:05 amenowanna