Skip to content

Commit

Permalink
add commit message after blame user
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Buliga committed Jun 19, 2019
1 parent 93b9f65 commit b757f1b
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var linenum = scimoz.lineFromPosition(scimoz.currentPos);
var basename = ko.views.manager.currentView.koDoc.file.baseName;
var dirname = ko.views.manager.currentView.koDoc.file.dirName;

// Run the svn blame process.
// Run the git blame process.
var runSvc = Components.classes["@activestate.com/koRunService;1"].
createInstance(Components.interfaces.koIRunService);
var cmd = 'git blame ' + basename;
Expand All @@ -15,9 +15,15 @@ var retval = process.wait(-1);
if (retval == 0) {
var stdout = process.getStdout();
var lines = stdout.split("\n");
var re = new RegExp("[0-9a-f]* \\((.*? [12][09][0-9]{2}-[0-9]{2}-[0-9]{2}) ");
var re = new RegExp("([0-9a-f]*) \\((.*? [12][09][0-9]{2}-[0-9]{2}-[0-9]{2}) ");
var match = re.exec(lines[linenum]);
if (match) {
ko.statusBar.AddMessage("BLAME: " + match[1], "editor", 10000, true);
cmd = 'git log --format=%s -n 1' + match[1];
process = runSvc.RunAndNotify(cmd, dirname, '', '');
retval = process.wait(-1);
ko.statusBar.AddMessage("BLAME: " + match[2], "editor", 10000, true);
if (retval == 0) {
ko.statusBar.AddMessage( process.getStdout(), "editor", 10000, true);
}
}
}
}

0 comments on commit b757f1b

Please sign in to comment.