git-gui: Enhance choose_rev to handle hundreds of branches
One of my production repositories has hundreds of remote tracking branches. Trying to navigate these through a popup menu is just not possible. The list is far larger than the screen and it does not scroll fast enough to efficiently select a branch name when trying to create a branch or delete a branch. This is major rewrite of the revision chooser mega-widget. We now use a single listbox for all three major types of named refs (heads, tracking branches, tags) and a radio button group to pick which of those namespaces should be shown in the listbox. A filter field is shown to the right allowing the end-user to key in a glob specification to filter the list they are viewing. The filter is always taken as substring, so we assume * both starts and ends the pattern the user wanted but otherwise treat it as a glob pattern. This new picker works out really nicely. What used to take me at least a minute to find and select a branch now takes mere seconds. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
@ -63,7 +63,7 @@ constructor dialog {} {
|
||||
pack $w.desc -anchor nw -fill x -pady 5 -padx 5
|
||||
|
||||
set w_rev [::choose_rev::new $w.rev {Starting Revision}]
|
||||
pack $w.rev -anchor nw -fill x -pady 5 -padx 5
|
||||
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
|
||||
|
||||
labelframe $w.options -text {Options}
|
||||
|
||||
@ -170,13 +170,7 @@ method _create {} {
|
||||
return
|
||||
}
|
||||
|
||||
if {[catch {set new [$w_rev get_commit]}]} {
|
||||
tk_messageBox \
|
||||
-icon error \
|
||||
-type ok \
|
||||
-title [wm title $w] \
|
||||
-parent $w \
|
||||
-message "Invalid revision: [$w_rev get]"
|
||||
if {[catch {set new [$w_rev commit_or_die]}]} {
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user