Skip to content

Commit c2fd102

Browse files
author
Julian Buliga
committed
add commit message after blame user
1 parent 93b9f65 commit c2fd102

File tree

1 file changed

+9
-3
lines changed
  • recipes/JavaScript/578537_Komodo_JS_Macro__show_git_blame_current_editor

1 file changed

+9
-3
lines changed

recipes/JavaScript/578537_Komodo_JS_Macro__show_git_blame_current_editor/recipe-578537.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var linenum = scimoz.lineFromPosition(scimoz.currentPos);
44
var basename = ko.views.manager.currentView.koDoc.file.baseName;
55
var dirname = ko.views.manager.currentView.koDoc.file.dirName;
66

7-
// Run the svn blame process.
7+
// Run the git blame process.
88
var runSvc = Components.classes["@activestate.com/koRunService;1"].
99
createInstance(Components.interfaces.koIRunService);
1010
var cmd = 'git blame ' + basename;
@@ -15,9 +15,15 @@ var retval = process.wait(-1);
1515
if (retval == 0) {
1616
var stdout = process.getStdout();
1717
var lines = stdout.split("\n");
18-
var re = new RegExp("[0-9a-f]* \\((.*? [12][09][0-9]{2}-[0-9]{2}-[0-9]{2}) ");
18+
var re = new RegExp("([0-9a-f]*) \\((.*? [12][09][0-9]{2}-[0-9]{2}-[0-9]{2}) ");
1919
var match = re.exec(lines[linenum]);
2020
if (match) {
21-
ko.statusBar.AddMessage("BLAME: " + match[1], "editor", 10000, true);
21+
cmd = 'git log --format=%s -n 1 ' + match[1];
22+
process = runSvc.RunAndNotify(cmd, dirname, '', '');
23+
retval = process.wait(-1);
24+
ko.statusBar.AddMessage("BLAME: " + match[2], "editor", 10000, true);
25+
if (retval == 0) {
26+
ko.statusBar.AddMessage( process.getStdout(), "editor", 10000, true);
27+
}
2228
}
2329
}

0 commit comments

Comments
 (0)