Commit c55b2e65 authored by Sven Strickroth's avatar Sven Strickroth

LogDlg: Allow to search in commit notes

Partly fixes issue #2531.
Signed-off-by: Sven Strickroth's avatarSven Strickroth <email@cs-ware.de>
parent bbf2e76b
......@@ -14,6 +14,7 @@ Released: unreleased
* Fixed issue #2604: Tag using TortoiseGitProc.exe /command:tag should accept a tag name argument
* Fixed issue #2609: Start scrolling the log from the bottom of the window rather than the top when finishing the progress
* Fixed issue #2608: Need a cancel option when cancelling a "restore after commit"
* LogDlg: Allow to search in commit notes
== Bug Fixes ==
* TortoiseGitMerge highlights wrong line in case of file starts with LF+CRLF
......
......@@ -3187,6 +3187,14 @@ BOOL CGitLogListBase::IsMatchFilter(bool bRegex, GitRevLoglist* pRev, std::tr1::
}
}
if (m_SelectedFilters & LOGFILTER_NOTES)
{
if (std::regex_search(std::wstring(pRev->m_Notes), pat, flags))
{
return TRUE;
}
}
if (m_SelectedFilters & LOGFILTER_REFNAME)
{
STRING_VECTOR refs = m_HashMap[pRev->m_CommitHash];
......@@ -3302,6 +3310,17 @@ BOOL CGitLogListBase::IsMatchFilter(bool bRegex, GitRevLoglist* pRev, std::tr1::
}
}
if (m_SelectedFilters & LOGFILTER_NOTES)
{
CString msg = pRev->m_Notes;
if (!m_bFilterCaseSensitively)
msg = msg.MakeLower();
if ((msg.Find(find) >= 0))
{
return result;
}
}
if (m_SelectedFilters & LOGFILTER_REVS)
{
sRev = pRev->m_CommitHash.ToString();
......
......@@ -52,7 +52,8 @@
#define LOGFILTER_SUBJECT 0x0040
#define LOGFILTER_REFNAME 0x0080
#define LOGFILTER_EMAILS 0x0100
#define LOGFILTER_CASE 0x0200
#define LOGFILTER_NOTES 0x0200
#define LOGFILTER_CASE 0x0400
#define LOGLIST_SHOWNOTHING 0x0000
#define LOGLIST_SHOWLOCALBRANCHES 0x0001
......
......@@ -2097,6 +2097,9 @@ LRESULT CLogDlg::OnClickedInfoIcon(WPARAM wParam, LPARAM lParam)
temp.LoadString(IDS_LOG_FILTER_REFNAME);
popup.AppendMenu(LOGMENUFLAGS(LOGFILTER_REFNAME), LOGFILTER_REFNAME, temp);
temp.LoadString(IDS_NOTES);
popup.AppendMenu(LOGMENUFLAGS(LOGFILTER_NOTES), LOGFILTER_NOTES, temp);
if (m_LogList.m_bShowBugtraqColumn == TRUE) {
temp.LoadString(IDS_LOG_FILTER_BUGIDS);
popup.AppendMenu(LOGMENUFLAGS(LOGFILTER_BUGID), LOGFILTER_BUGID, temp);
......@@ -2247,6 +2250,13 @@ void CLogDlg::SetFilterCueText()
temp += CString(MAKEINTRESOURCE(IDS_LOG_FILTER_REFNAME));
}
if (m_LogList.m_SelectedFilters & LOGFILTER_NOTES)
{
if (temp.ReverseFind(_T(' ')) != temp.GetLength() - 1)
temp += _T(", ");
temp += CString(MAKEINTRESOURCE(IDS_NOTES));
}
if (m_LogList.m_bShowBugtraqColumn && m_LogList.m_SelectedFilters & LOGFILTER_BUGID)
{
if (temp.ReverseFind(_T(' ')) != temp.GetLength() - 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment