[utilities/kate] addons/git-blame: Added "Open commit" link after commit hash in git blame tooltip
Christoph Cullmann <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit a891a4ce7c430d117fd6eaa902c82732c8592d48 by Christoph Cullmann, on behalf of Leo Ruggeri.
Committed on 25/07/2026 at 11:45.
Pushed by cullmann into branch 'master'.
Added "Open commit" link after commit hash in git blame tooltip
M +2 -3 addons/git-blame/kategitblameplugin.cpp
https://invent.kde.org/utilities/kate/-/commit/a891a4ce7c430d117fd6eaa902c82732c8592d48
diff --git a/addons/git-blame/kategitblameplugin.cpp b/addons/git-blame/kategitblameplugin.cpp
index d4fb419803..8a4993611a 100644
--- a/addons/git-blame/kategitblameplugin.cpp
+++ b/addons/git-blame/kategitblameplugin.cpp
@@ -323,7 +323,7 @@ void KateGitBlamePluginView::startShowProcess(const QUrl &url, const QString &ha
const QFileInfo fi{url.toLocalFile()};
m_absoluteFilePath = fi.absoluteFilePath();
- if (!setupGitProcess(m_showProc, fi.absolutePath(), {QStringLiteral("show"), hash, QStringLiteral("--numstat")})) {
+ if (!setupGitProcess(m_showProc, fi.absolutePath(), {QStringLiteral("show"), hash, QStringLiteral("--numstat"), QStringLiteral("--abbrev-commit")})) {
return;
}
startHostProcess(m_showProc, QIODevice::ReadOnly);
@@ -434,10 +434,9 @@ void KateGitBlamePluginView::showFinished(int exitCode, QProcess::ExitStatus exi
const QString prefix = QLatin1String("commit ");
int start = stdOut.indexOf(prefix);
if (start != -1) {
- start += prefix.length();
int end = stdOut.indexOf(u'\n', start);
if (end != -1) {
- stdOut.replace(start, end - start, QLatin1String("<a href=\"%1\">%1</a>").arg(commitHashArg));
+ stdOut.insert(end, QLatin1String(" (<a href=\"%1\">Open commit</a>)").arg(commitHashArg));
}
}