Highlights any commit that touches a file.
The "Show history of file" context menu item will now set the path search instead of creating a rev specifier.
-s or --search= for searching in subject, author or SHA
-S or --Search= for git's pickaxe string matching
-r or --regex= for git's pickaxe regex matching
Add two new search modes to search the commits for strings that were added or removed in a commit.
- match by string or an extended POSIX regex (see man git-log -S<string> and --pickaxe-regex)
- include the modes in the search menu
- store the current mode in user defaults
- show progress indicator when search takes time
Previously searching would filter the commits in the commit tableview to only show the commits that matched the search. However the context of where those commits exist in the history is lost.
With this patch all the commits are shown but the commits that match the search are highlighted with a light blue background. In addition there is a forward/back button to step through the matches.
A new search controller:
- keeps track of the matching results
- finds the next or previous result
- displays the number of matches found or "Not found"
- shows/hides the # of matches text and the next/last stepper button
- shows a small bezel style window with a rewind icon indicating that the selection has cycled (pressing next when at the last match or previous when at the first)
- sets up the search predicate which covers Subject, Author and SHA (previously this was three different searches)
- stores search results in an NSIndexSet to make finding if a row is in the set faster (needed at drawing time)
Highlighting of search result rows is done in PBCommitList -drawRow:clipRect:
PBGitTextFieldCell is a subclass of NSTextFieldCell that disables the cell's selection highlighting.
Supporting Find Next and Find Previous (cmd-g and cmd-shift-g) menu commands required changing the action method of the menu items because NSTextFields (seem to) actively disable items in the Find menu.
rewindImage.pdf created by Nathan Kinsinger