From b757f1b7de31b08a4fafdfa52c7cff97ce105293 Mon Sep 17 00:00:00 2001 From: Julian Buliga Date: Wed, 19 Jun 2019 11:10:11 -0700 Subject: [PATCH] add commit message after blame user --- .../recipe-578537.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/recipes/JavaScript/578537_Komodo_JS_Macro__show_git_blame_current_editor/recipe-578537.js b/recipes/JavaScript/578537_Komodo_JS_Macro__show_git_blame_current_editor/recipe-578537.js index e73289e5f..5d02321a8 100644 --- a/recipes/JavaScript/578537_Komodo_JS_Macro__show_git_blame_current_editor/recipe-578537.js +++ b/recipes/JavaScript/578537_Komodo_JS_Macro__show_git_blame_current_editor/recipe-578537.js @@ -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; @@ -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); + } } -} +} \ No newline at end of file