Gitlogg is broken for some repositories
See original GitHub issuegitlogg-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
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:21 (19 by maintainers)
Top Results From Across the Web
dreamyguy/gitlogg: Parse the 'git log' of multiple ... - GitHub
Parse the 'git log' of one or several 'git' repositories into a sanitised and distributable 'JSON' file. MIT Licence Data served by Gitlogg...
Read more >fix broken git history after merging other repo into subdir
The question/solution Git log shows very little after doing a read-tree merge and How can I rewrite history so that all files, except...
Read more >git-log Documentation - Git
Show all commits more recent than a specific date. ... Pretend as if all objects mentioned as ref tips of alternate repositories were...
Read more >Repairing and recovering broken git repositories - Git Cookbook
Repairing and recovering broken git repositories ... Try a git fetch to see if some of them come back (tags and remote refs)....
Read more >Recovering from broken Git repo
How to do basic recovery from broken Git repo, perhaps due to power loss during git commit.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
@Inventitech I just tested these repos and got no error.
To be 100% sure we’re taking the exact same steps, I’ve put this one-liner together. It’s the same line I’ve used to test:
Run the line and let me know how it goes.
If you don’t get it to work, let me know the specs of your OS and I’ll open another issue that’s specific to Linux, for I can’t reproduce it on OSX.