diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 0d34fd25a8d..74124a65f00 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -635,6 +635,10 @@ public: tr("Show textual graph log.")); mapSetting(graphButton, settings.boolPointer(GitSettings::graphLogKey)); + QAction *followButton = addToggleButton("--follow", tr("Follow"), + tr("Show log also for previous names of the file.")); + mapSetting(followButton, settings.boolPointer(GitSettings::followRenamesKey)); + addButton(tr("Reload"), Utils::Icons::RELOAD.icon()); } }; @@ -1032,7 +1036,7 @@ void GitClient::log(const QString &workingDirectory, const QString &fileName, arguments << argWidget->arguments(); if (!fileName.isEmpty()) - arguments << "--follow" << "--" << fileName; + arguments << "--" << fileName; vcsExec(workingDir, arguments, editor); } diff --git a/src/plugins/git/gitsettings.cpp b/src/plugins/git/gitsettings.cpp index ee47d3075ea..ecc355fa508 100644 --- a/src/plugins/git/gitsettings.cpp +++ b/src/plugins/git/gitsettings.cpp @@ -45,6 +45,7 @@ const QLatin1String GitSettings::logDiffKey("LogDiff"); const QLatin1String GitSettings::repositoryBrowserCmd("RepositoryBrowserCmd"); const QLatin1String GitSettings::graphLogKey("GraphLog"); const QLatin1String GitSettings::firstParentKey("FirstParent"); +const QLatin1String GitSettings::followRenamesKey("FollowRenames"); const QLatin1String GitSettings::lastResetIndexKey("LastResetIndex"); GitSettings::GitSettings() @@ -66,6 +67,7 @@ GitSettings::GitSettings() declareKey(repositoryBrowserCmd, QString()); declareKey(graphLogKey, false); declareKey(firstParentKey, false); + declareKey(followRenamesKey, true); declareKey(lastResetIndexKey, 0); } diff --git a/src/plugins/git/gitsettings.h b/src/plugins/git/gitsettings.h index b6778dfca5c..4bd088c8528 100644 --- a/src/plugins/git/gitsettings.h +++ b/src/plugins/git/gitsettings.h @@ -56,6 +56,7 @@ public: static const QLatin1String repositoryBrowserCmd; static const QLatin1String graphLogKey; static const QLatin1String firstParentKey; + static const QLatin1String followRenamesKey; static const QLatin1String lastResetIndexKey; Utils::FilePath gitExecutable(bool *ok = nullptr, QString *errorMessage = nullptr) const;