From 4312a13db49189d17d608ddc8d35b6c6d03f43d8 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sat, 25 Apr 2015 20:36:38 +0200 Subject: [PATCH] Fixed issue #2469: Support reviewing merge commits (git show merge-commit) Signed-off-by: Sven Strickroth --- Languages/Tortoise.pot | 4 ++++ src/Changelog.txt | 1 + src/Resources/TortoiseProcENG.rc | 1 + src/TortoiseProc/GitLogListAction.cpp | 15 ++++++++++++++- src/TortoiseProc/GitLogListBase.cpp | 1 + src/TortoiseProc/resource.h | 1 + 6 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Languages/Tortoise.pot b/Languages/Tortoise.pot index badd5bcf2..63332a253 100644 --- a/Languages/Tortoise.pot +++ b/Languages/Tortoise.pot @@ -8534,6 +8534,10 @@ msgstr "" msgid "Show branches this commit is on" msgstr "" +#. Resource IDs: (1564) +msgid "Show changes after merge" +msgstr "" + #. Resource IDs: (20011, 20026) msgid "Show changes as &unified diff" msgstr "" diff --git a/src/Changelog.txt b/src/Changelog.txt index 41ebb9b86..e076a3e10 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -5,6 +5,7 @@ Released: unreleased * Fixed issue #2245: Make the meaning of "Squash" clearer * Fixed issue #2488: BrowseRefsDlg: Option to hide nested branches * Fixed issue #2490: BrowseRefsDlg: Allow to configure tracked branches + * Fixed issue #2469: Support reviewing merge commits (git show merge-commit) == Bug Fixes == * Fixed issue #2495: "Show Reflog" dialog shows empty action for "push" entries diff --git a/src/Resources/TortoiseProcENG.rc b/src/Resources/TortoiseProcENG.rc index 0e40c52d6..4294a997a 100644 --- a/src/Resources/TortoiseProcENG.rc +++ b/src/Resources/TortoiseProcENG.rc @@ -4009,6 +4009,7 @@ BEGIN IDS_PROC_REBASE_UNSELECTED_SKIP "S&kip unselected" IDS_PROC_REBASE_UNSELECTED_SQUASH "S&quash unselected" IDS_PROC_REBASE_UNSELECTED_EDIT "E&dit unselected" + IDS_DIFFWITHMERGE "Show changes after merge" END STRINGTABLE diff --git a/src/TortoiseProc/GitLogListAction.cpp b/src/TortoiseProc/GitLogListAction.cpp index 5817577f8..7f5049a9f 100644 --- a/src/TortoiseProc/GitLogListAction.cpp +++ b/src/TortoiseProc/GitLogListAction.cpp @@ -194,9 +194,22 @@ void CGitLogList::ContextMenuAction(int cmd,int FirstSelect, int LastSelect, CMe cmd >>= 16; if( (cmd&0xFFFF) == 0xFFFF) bMerge = true; - else if((cmd&0xFFFF) == 0xFFFE) bCombine = true; + else if ((cmd & 0xFFFF) == 0xFFFD) + { + CString tempfile = GetTempFile(); + CString cmd = _T("git.exe diff-tree --cc ") + r1->m_CommitHash.ToString(); + CString lastErr; + if (g_Git.RunLogFile(cmd, tempfile, &lastErr)) + { + MessageBox(lastErr, _T("TortoiseGit"), MB_ICONERROR); + break; + } + + CAppUtils::StartUnifiedDiffViewer(tempfile, _T("dd")); + break; + } else { if(cmd > r1->m_ParentHash.size()) diff --git a/src/TortoiseProc/GitLogListBase.cpp b/src/TortoiseProc/GitLogListBase.cpp index 15e2440ed..97a5cb0e3 100644 --- a/src/TortoiseProc/GitLogListBase.cpp +++ b/src/TortoiseProc/GitLogListBase.cpp @@ -1895,6 +1895,7 @@ void CGitLogListBase::OnContextMenu(CWnd* pWnd, CPoint point) gnudiffmenu.AppendMenuIcon((UINT_PTR)(ID_GNUDIFF1 + (0xFFFF << 16)), CString(MAKEINTRESOURCE(IDS_ALLPARENTS))); gnudiffmenu.AppendMenuIcon((UINT_PTR)(ID_GNUDIFF1 + (0xFFFE << 16)), CString(MAKEINTRESOURCE(IDS_ONLYMERGEDFILES))); + gnudiffmenu.AppendMenuIcon((UINT_PTR)(ID_GNUDIFF1 + (0xFFFD << 16)), CString(MAKEINTRESOURCE(IDS_DIFFWITHMERGE))); for (size_t i = 0; i < parentHash.size(); ++i) { diff --git a/src/TortoiseProc/resource.h b/src/TortoiseProc/resource.h index 53e4ca572..a1e176c9e 100644 --- a/src/TortoiseProc/resource.h +++ b/src/TortoiseProc/resource.h @@ -1234,6 +1234,7 @@ #define IDC_STATUS_STATIC 1563 #define IDS_PROC_REBASE_UNSELECTED_EDIT 1563 #define IDC_REBASE_CONTINUE 1564 +#define IDS_DIFFWITHMERGE 1564 #define IDC_REBASE_ABORT 1565 #define IDC_REBASE_DUMY_TAB 1566 #define IDC_GIT_USERNAME 1566 -- 2.11.4.GIT