forked from qt-creator/qt-creator
Git: Ignore irrelevant changes in instant blame
Optionally ignore whitespace changes or line moves to only show the last real code changes. Feature is disabled by default. Fixes: QTCREATORBUG-29378 Change-Id: Ia2d5ad926f4098554b1ed3365bffadd4e2063e8e Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
committed by
André Hartmann
parent
497bcbbf97
commit
e49ac10cb1
@@ -224,7 +224,7 @@ public:
|
||||
|
||||
QString toolTipText(const CommitInfo &info) const
|
||||
{
|
||||
const QString result = QString(
|
||||
QString result = QString(
|
||||
"<table>"
|
||||
" <tr><td>commit</td><td>%1</td></tr>"
|
||||
" <tr><td>Author:</td><td>%2 <%3></td></tr>"
|
||||
@@ -234,6 +234,12 @@ public:
|
||||
"</table>")
|
||||
.arg(info.sha1, info.author, info.authorMail,
|
||||
info.authorTime.toString("yyyy-MM-dd hh:mm:ss"), info.summary);
|
||||
|
||||
if (settings().instantBlameIgnoreSpaceChanges()
|
||||
|| settings().instantBlameIgnoreLineMoves()) {
|
||||
result.append(Tr::tr("<p><b>Note:</b> Ignore whitespace changes or line moves"
|
||||
" is enabled in the instant blame settings.</p>"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
@@ -1574,9 +1580,14 @@ void GitPluginPrivate::instantBlame()
|
||||
const CommitInfo info = parseBlameOutput(output.split('\n'), filePath, m_author);
|
||||
m_blameMark.reset(new BlameMark(filePath, line, info));
|
||||
};
|
||||
gitClient().vcsExecWithHandler(workingDirectory,
|
||||
{"blame", "-p", "-L", lineString, "--", filePath.toString()},
|
||||
this, commandHandler, RunFlags::NoOutput, m_codec);
|
||||
QStringList options = {"blame", "-p"};
|
||||
if (settings().instantBlameIgnoreSpaceChanges())
|
||||
options.append("-w");
|
||||
if (settings().instantBlameIgnoreLineMoves())
|
||||
options.append("-M");
|
||||
options.append({"-L", lineString, "--", filePath.toString()});
|
||||
gitClient().vcsExecWithHandler(workingDirectory, options, this,
|
||||
commandHandler, RunFlags::NoOutput, m_codec);
|
||||
}
|
||||
|
||||
void GitPluginPrivate::stopInstantBlame()
|
||||
|
Reference in New Issue
Block a user