Misleading Messagebox after pull with rebase, when branch is behind origin/branch, but origin/branch=remote/origin/master
What steps will reproduce the problem?
- Assume you have a repository where origin/branchname is equal to remote/origin/branchname, but branchname (local) branch is behind orinin/branchname (for example because a git fetch was executed before)
- Press pull, check "Launch rebase after fetch"
- The message IDS_REBASE_BRANCH_UNCHANGED "The remote branch has not changed. Open the rebase dialog anyway?"
What is the expected output? What do you see instead?
In my opinion the message "The remote branch has not changed. Open the rebase dialog anyway?" is a bit misleading, because the fact that the current branch is behind origin/branch is not clearly visible.
In my opinion the message IDS_REBASE_BRANCH_FF "The fetched branch fast-forwards upon the current branch. Merge or open the rebase dialog anyway?" would make more sense.
What version of TortoiseGit and Git are you using? On what operating system?
Latest version on Windows 7
Suggested Solution:
I suggest to check if the headHash is equal to the remoteBranchHast before the IDS_REBASE_BRANCH_UNCHANGED message is displayed:
Open src/TortoiseProc/AppUtils.cpp
L 2663:
Replace
if (remoteBranchHash == oldUpstreamHash
&& !oldUpstreamHash.IsEmpty()
&& CMessageBox::ShowCheck(hWnd, IDS_REBASE_BRANCH_UNCHANGED, IDS_APPNAME, MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2, L"OpenRebaseRemoteBranchUnchanged", IDS_MSGBOX_DONOTSHOWAGAIN) == IDNO)
return;
by
if (remoteBranchHash == oldUpstreamHash
&& remoteBranchHash == headHash
&& !oldUpstreamHash.IsEmpty()
&& CMessageBox::ShowCheck(hWnd, IDS_REBASE_BRANCH_UNCHANGED, IDS_APPNAME, MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2, L"OpenRebaseRemoteBranchUnchanged", IDS_MSGBOX_DONOTSHOWAGAIN) == IDNO)
return;