From 7883110e45aa27bb6933072d39ec69d9d6e82960 Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Mon, 21 Dec 2020 13:13:36 +0100 Subject: [PATCH] Git: Clarify rebase and merge actions in branch view While merge should be clear, it's sometimes hard to understand which branch is rebased on top of the other. Let's be explicit and state that in the context menu. Change-Id: I9755a9220a0a5930ce96893e2fad06221d449d9c Reviewed-by: Leena Miettinen Reviewed-by: Orgad Shaneh --- src/plugins/git/branchview.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/plugins/git/branchview.cpp b/src/plugins/git/branchview.cpp index b0c97935050..959429569f9 100644 --- a/src/plugins/git/branchview.cpp +++ b/src/plugins/git/branchview.cpp @@ -212,7 +212,9 @@ void BranchView::slotCustomContextMenu(const QPoint &point) return; const QModelIndex index = m_filterModel->mapToSource(filteredIndex); + const QString indexName = m_model->fullName(index); const QModelIndex currentBranch = m_model->currentBranch(); + const QString currentName = m_model->fullName(currentBranch); const bool currentSelected = index.sibling(index.row(), 0) == currentBranch; const bool isLocal = m_model->isLocal(index); const bool isTag = m_model->isTag(index); @@ -261,14 +263,20 @@ void BranchView::slotCustomContextMenu(const QPoint &point) contextMenu.addMenu(resetMenu); QString mergeTitle; if (isFastForwardMerge()) { - contextMenu.addAction(tr("&Merge (Fast-Forward)"), this, [this] { merge(true); }); - mergeTitle = tr("Merge (No &Fast-Forward)"); + contextMenu.addAction(tr("&Merge \"%1\" into \"%2\" (Fast-Forward)") + .arg(indexName, currentName), + this, [this] { merge(true); }); + mergeTitle = tr("Merge \"%1\" into \"%2\" (No &Fast-Forward)") + .arg(indexName, currentName); } else { - mergeTitle = tr("&Merge"); + mergeTitle = tr("&Merge \"%1\" into \"%2\"") + .arg(indexName, currentName); } contextMenu.addAction(mergeTitle, this, [this] { merge(false); }); - contextMenu.addAction(tr("&Rebase"), this, &BranchView::rebase); + contextMenu.addAction(tr("&Rebase \"%1\" on \"%2\"") + .arg(currentName, indexName), + this, &BranchView::rebase); contextMenu.addSeparator(); contextMenu.addAction(tr("Cherry &Pick"), this, &BranchView::cherryPick); }