gitlogg: Gitlogg is broken for some repositories
gitlogg-parse-json.js is broken.
sh gitlogg-generate-log.sh
-e Generating git log for all repositories located at '../travistorrent-tools'. This might take a while!
-e The file ./gitlogg.tmp generated in: 0s
Generating JSON output...
[stdin]:40
author_name = item[16].replace(/"/g, "'"),
^
TypeError: Cannot read property 'replace' of undefined
at [stdin]:40:25
at Array.reduce (native)
at [stdin]:23:4
at Object.exports.runInThisContext (vm.js:54:17)
at Object.<anonymous> ([stdin]-wrapper:6:22)
at Module._compile (module.js:409:26)
at node.js:579:27
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickCallback (node.js:349:13)
Minimally demonstrative example: Analyse repository TestRoots/travistorrent-tools.
Thanks for looking into this 😃, I liked the way you prepare the git log output in gitlogg-generate-log.sh. Should this problem be related to git log behaving strangely (printing/not prinitng empty lines), I might have a clean fix with awk.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 21 (19 by maintainers)
After breaking down the git log and parsing step by step, I discovered that there was actually a carriage return (^M) character in one of the Git commit messages being parsed, which was adding an extra newline and throwing all subsequent parsing off as a result.
Modifying the parsing in gitlogg-generate-log.sh to include a carriage return deletion allows me to get past the issue.