FredrikNoren / ungit

The easiest way to use git. On any platform. Anywhere.
MIT License
10.45k stars 640 forks source link

Git-parser crashes on parseGitLog, message.trim #125

Closed FredrikNoren closed 11 years ago

FredrikNoren commented 11 years ago

@brayann reported this error in #112

typeError: Cannot call method 'trim' of undefined
at /usr/local/lib/node_modules/ungit/source/git-parser.js:149:69
at Array.forEach (native)
at Object.exports.parseGitLog [as parser] (/usr/local/lib/node_modules/ungit/source/git-parser.js:149:10)
at /usr/local/lib/node_modules/ungit/source/git.js:28:42
at ChildProcess.exithandler (child_process.js:635:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket.<anonymous> (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
sorin-ionescu commented 11 years ago

I can report something similar.

error: TypeError: Cannot read property '1' of null
    at Object.exports.parseGitDiff [as parser] (/Users/sorin/.homebrew/lib/node_modules/ungit/source/git-parser.js:34:20)
    at /Users/sorin/.homebrew/lib/node_modules/ungit/source/git.js:28:42
    at ChildProcess.exithandler (child_process.js:635:7)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:735:16)
    at Socket.<anonymous> (child_process.js:948:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:466:12)
tedchoward commented 11 years ago

I am also getting this error. I think it has to do with the fact that I have some commits with no commit message. (The project was imported from an old SVN repo where that was allowed.)

Clone this repo: https://github.com/tedchoward/ThinWire.git and run ungit. When you begin to scroll down the page, you should get the error.

stack trace:


/usr/local/share/npm/lib/node_modules/ungit/source/git-parser.js:149
    commits.forEach(function(commit) { commit.message = commit.message.trim(); })
                                                                       ^
TypeError: Cannot call method 'trim' of undefined
    at /usr/local/share/npm/lib/node_modules/ungit/source/git-parser.js:149:69
    at Array.forEach (native)
    at Object.exports.parseGitLog [as parser] (/usr/local/share/npm/lib/node_modules/ungit/source/git-parser.js:149:10)
    at /usr/local/share/npm/lib/node_modules/ungit/source/git.js:28:42
    at ChildProcess.exithandler (child_process.js:635:7)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:735:16)
    at Socket.<anonymous> (child_process.js:948:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:466:12)
tedchoward commented 11 years ago

Pull Request #147 should take care of this.

FredrikNoren commented 11 years ago

@sorin-ionescu move your report to #149

Closing this ticket, the PR should fix it. Re-open if it re-occurs in the next release.