From 293dd59c2b784c4661874964bdbb327a5d91f8a8 Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Thu, 3 Oct 2024 12:50:49 +0200 Subject: [PATCH] Git: Add "show all branches" option to log window Seems most useful for file logs, but it can also help the keep the overview of several work branches. Change-Id: I7f794c6f7ed22351a5e0da5806fa3934cfa4bbff Reviewed-by: Orgad Shaneh --- src/plugins/git/gitclient.cpp | 5 +++++ src/plugins/git/gitsettings.cpp | 1 + src/plugins/git/gitsettings.h | 1 + 3 files changed, 7 insertions(+) diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 07ed22ebe52..ea60ac555a2 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -647,6 +647,11 @@ public: GitLogConfig(bool fileRelated, GitEditorWidget *editor) : GitBaseConfig(editor) { + QAction *allBranchesButton = + addToggleButton(QStringList{"--all"}, + Tr::tr("All"), + Tr::tr("Show log for all local branches.")); + mapSetting(allBranchesButton, &settings().allBranches); QAction *firstParentButton = addToggleButton({"-m", "--first-parent"}, Tr::tr("First Parent"), diff --git a/src/plugins/git/gitsettings.cpp b/src/plugins/git/gitsettings.cpp index daabb4dac1f..1021fbddb61 100644 --- a/src/plugins/git/gitsettings.cpp +++ b/src/plugins/git/gitsettings.cpp @@ -113,6 +113,7 @@ GitSettings::GitSettings() colorLog.setSettingsKey("ColorLog"); colorLog.setDefaultValue(true); + allBranches.setSettingsKey("AllBranches"); firstParent.setSettingsKey("FirstParent"); followRenames.setSettingsKey("FollowRenames"); diff --git a/src/plugins/git/gitsettings.h b/src/plugins/git/gitsettings.h index 97a2ab787fb..6844b8e2029 100644 --- a/src/plugins/git/gitsettings.h +++ b/src/plugins/git/gitsettings.h @@ -33,6 +33,7 @@ public: Utils::FilePathAspect repositoryBrowserCmd{this}; Utils::BoolAspect graphLog{this}; Utils::BoolAspect colorLog{this}; + Utils::BoolAspect allBranches{this}; Utils::BoolAspect firstParent{this}; Utils::BoolAspect followRenames{this}; Utils::IntegerAspect lastResetIndex{this};