From 228710b8841ac684e2d83ddb9489ae74b712b6ab Mon Sep 17 00:00:00 2001 From: Frank Li Date: Fri, 30 Jan 2009 14:54:47 +0800 Subject: [PATCH] Add Show "No Merge" and "First Parent Only" Option at Show ALL menu button Signed-off-by: Frank Li --- src/Git/Git.cpp | 5 +++++ src/Git/Git.h | 4 +++- src/Resources/TortoiseProcENG.rc | Bin 399668 -> 399838 bytes src/TortoiseProc/GitLogListBase.cpp | 6 +++--- src/TortoiseProc/GitLogListBase.h | 2 +- src/TortoiseProc/LogDlg.cpp | 18 ++++++++++++++---- src/TortoiseProc/resource.h | Bin 147334 -> 147492 bytes 7 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/Git/Git.cpp b/src/Git/Git.cpp index 86a3e59..3a49ed0 100644 --- a/src/Git/Git.cpp +++ b/src/Git/Git.cpp @@ -267,6 +267,11 @@ int CGit::GetLog(BYTE_VECTOR& logOut, CString &hash, CTGitPath *path ,int count if(mask& CGit::LOG_INFO_DETECT_RENAME ) param += _T(" -M "); + if(mask& CGit::LOG_INFO_FIRST_PARENT ) + param += _T(" --first-parent "); + + if(mask& CGit::LOG_INFO_NO_MERGE ) + param += _T(" --no-merges "); param+=hash; cmd.Format(_T("git.exe log %s -z --topo-order --parents %s --pretty=format:\""), diff --git a/src/Git/Git.h b/src/Git/Git.h index 406bfa9..d254b76 100644 --- a/src/Git/Git.h +++ b/src/Git/Git.h @@ -49,7 +49,9 @@ public: LOG_INFO_ALL_BRANCH=0x20, LOG_INFO_ONLY_HASH=0x40, LOG_INFO_DETECT_RENAME=0x80, - LOG_INFO_DETECT_COPYRENAME=0x100 + LOG_INFO_DETECT_COPYRENAME=0x100, + LOG_INFO_FIRST_PARENT = 0x200, + LOG_INFO_NO_MERGE = 0x400, }LOG_INFO_MASK; int GetRemoteList(STRING_VECTOR &list); diff --git a/src/Resources/TortoiseProcENG.rc b/src/Resources/TortoiseProcENG.rc index e74ca0b7efaf4e8f7aa79927007bf219798dbcaa..3da30e73eef08c19088583fd61b72b16e43ef392 100644 GIT binary patch delta 142 zcmdn8N#fpSiG~)&7N!>FEi5NIrzd!_$k@6ucrpYr1T%y%#4`jiI0D(O41PeK0)rBR z8$%{T5koOU36K}SkO*X_GUS1I{y;j1p>q054;E!rKL&rGW?!JjAO?3J$q7^r((cEQ c52Ss8nu-|Gr%$wD4Qv#j0{107SeV;s5{u delta 37 tcmcb&Sz^m3iG~)&7N!>FEi5NIr(3zRdQ9i>X5nf-;>EK4h!?BWc>ohQ4X^+J diff --git a/src/TortoiseProc/GitLogListBase.cpp b/src/TortoiseProc/GitLogListBase.cpp index 63bf3eb..e289dc5 100644 --- a/src/TortoiseProc/GitLogListBase.cpp +++ b/src/TortoiseProc/GitLogListBase.cpp @@ -86,7 +86,7 @@ CGitLogListBase::CGitLogListBase():CHintListCtrl() m_From=CTime(1970,1,2,0,0,0); m_To=CTime::GetCurrentTime(); - m_bAllBranch = FALSE; + m_ShowMask = 0; m_LoadingThread = NULL; m_bExitThread=FALSE; @@ -1326,8 +1326,8 @@ int CGitLogListBase::FillGitShortLog() CString hash; int mask; mask = CGit::LOG_INFO_ONLY_HASH | CGit::LOG_INFO_BOUNDARY; - if(this->m_bAllBranch) - mask |= CGit::LOG_INFO_ALL_BRANCH; +// if(this->m_bAllBranch) + mask |= m_ShowMask; this->m_logEntries.ParserShortLog(path,hash,-1,mask); diff --git a/src/TortoiseProc/GitLogListBase.h b/src/TortoiseProc/GitLogListBase.h index c37f92b..161f20b 100644 --- a/src/TortoiseProc/GitLogListBase.h +++ b/src/TortoiseProc/GitLogListBase.h @@ -154,7 +154,7 @@ public: CTime m_To; CTGitPath m_Path; - BOOL m_bAllBranch; + int m_ShowMask; void GetTimeRange(CTime &oldest,CTime &latest); virtual void ContextMenuAction(int cmd,int FirstSelect, int LastSelect)=0; diff --git a/src/TortoiseProc/LogDlg.cpp b/src/TortoiseProc/LogDlg.cpp index 36fa972..78d6677 100644 --- a/src/TortoiseProc/LogDlg.cpp +++ b/src/TortoiseProc/LogDlg.cpp @@ -338,6 +338,10 @@ BOOL CLogDlg::OnInitDialog() format.LoadString(IDS_LOG_SHOW_CURRENT_BRANCH); temp.Format(format,g_Git.GetCurrentBranch()); m_btnShow.AddEntry(temp); + temp.LoadString(IDS_LOG_SHOW_FIRST_PARENT); + m_btnShow.AddEntry(temp); + temp.LoadString(IDS_LOG_SHOW_NO_MERGE); + m_btnShow.AddEntry(temp); m_btnShow.SetCurrentEntry((LONG)CRegDWORD(_T("Software\\TortoiseGit\\ShowAllEntry"))); temp.LoadString(IDS_LOG_SHOW_WHOLE); @@ -410,12 +414,13 @@ LRESULT CLogDlg::OnLogListLoading(WPARAM wParam, LPARAM lParam) DialogEnableWindow(IDC_REFRESH, TRUE); // PostMessage(WM_TIMER, LOGFILTER_TIMER); - + GetDlgItem(IDC_PROGRESS)->ShowWindow(FALSE); //CTime time=m_LogList.GetOldestTime(); CTime begin,end; m_LogList.GetTimeRange(begin,end); m_DateFrom.SetTime(&begin); m_DateTo.SetTime(&end); + }else { @@ -640,11 +645,16 @@ void CLogDlg::GetAll(bool bIsShowProjectOrBranch) switch (entry) { case 0: // show all branch - m_LogList.m_bAllBranch=true; + m_LogList.m_ShowMask=CGit::LOG_INFO_ALL_BRANCH; break; case 1: // show current branch - m_LogList.m_bAllBranch=false; - + m_LogList.m_ShowMask=0; + break; + case 2: // first parent + m_LogList.m_ShowMask=CGit::LOG_INFO_FIRST_PARENT; + break; + case 3: // no merge + m_LogList.m_ShowMask=CGit::LOG_INFO_NO_MERGE; break; } } diff --git a/src/TortoiseProc/resource.h b/src/TortoiseProc/resource.h index 7ef0435e88b7f7c8462011e841debbe0f90158bd..cf2186c36386f8d8f551979458836ff8c501bb96 100644 GIT binary patch delta 110 zcmZqs&#|O|vtbKkUeWXeg^WV-ZVa9bK@7nRAq?>h0St~nwkv}lkjDvxh71;yHx|lH zH^^e-nSLOLkxSZ-!5^s37pNwP!5v6~RDsnoSWYf{DnI=~5F^|43q_1v+v|!LInDwA D^MV^e delta 22 dcmZ3|z}fbnqhSkUUeR=g5=MdTGR2G>X8~s&2q*vm -- 2.11.0