Git: Add instant line annotation (blame)

Inspired by the Visual Studio Code plugin GitLens.

Add an annotation to the editor line the cursor
is  currently in. A tooltip contains the commit
data and allows to invoke git show for the commit.

When the automatic annotation is turned off, it can
still be forced for the current line with an action.
The default shortcut for this action is: Alt+G,Alt+I

Task-number: QTCREATORBUG-23299
Change-Id: I58eef9efcf531afb11470e5f5456e19f282b18d0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2022-10-26 22:11:07 +02:00
committed by André Hartmann
parent ea917a0aa6
commit cae1936da3
6 changed files with 272 additions and 13 deletions

View File

@@ -77,6 +77,11 @@ public:
int behind = 0;
};
struct Author {
QString name;
QString email;
};
class GITSHARED_EXPORT GitClient : public VcsBase::VcsBaseClientImpl
{
public:
@@ -338,6 +343,7 @@ public:
Core::IEditor *openShowEditor(const Utils::FilePath &workingDirectory, const QString &ref,
const QString &path, ShowEditor showSetting = ShowEditor::Always);
Author getAuthor(const Utils::FilePath &workingDirectory);
private:
void finishSubmoduleUpdate();
void chunkActionsRequested(DiffEditor::DiffEditorController *controller,