1
0
mirror of https://github.com/git/git.git synced 2024-10-01 13:01:23 +02:00
Commit Graph

9 Commits

Author SHA1 Message Date
Shawn O. Pearce
827c71199d git-gui: Allow double-click in checkout dialog to start checkout
If the user double clicks a branch in the checkout dialog then they
probably want to start the checkout process on that branch.  I found
myself doing this without realizing it, and of course it did nothing
as there was no action bound to the listbox's Double-Button-1 event
handler.  Since I did it without thinking, others will probably also
try, and expect the same behavior.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-08 22:34:53 -04:00
Shawn O. Pearce
84d3d7b84c git-gui: Default selection to first matching ref
If we have specifications listed in our revision picker mega-widget
then we should default the selection within that widget to the first
ref available.  This way the user does not need to use the spacebar
to activate the selection of a ref within the box; instead they can
navigate up/down with the arrow keys and be done with it.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-08 22:34:52 -04:00
Shawn O. Pearce
d41b43eb4c git-gui: Refactor branch switch to support detached head
This is a major rewrite of the way we perform switching between
branches and the subsequent update of the working directory.  Like
core Git we now use a single code path to perform all changes: our
new checkout_op class.  We also use it for branch creation/update
as it integrates the tracking branch fetch process along with a
very basic merge (fast-forward and reset only currently).

Because some users have literally hundreds of local branches we
use the standard revision picker (with its branch filtering tool)
to select the local branch, rather than keeping all of the local
branches in the Branch menu.  The branch menu listing out all of
the available branches is simply not sane for those types of huge
repositories.

Users can now checkout a detached head by ticking off the option
in the checkout dialog.  This option is off by default for the
obvious reason, but it can be easily enabled for any local branch
by simply checking it.  We also detach the head if any non local
branch was selected, or if a revision expression was entered.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-08 22:34:46 -04:00
Shawn O. Pearce
7cf0442667 git-gui: Option to default new branches to match tracking branches
In some workflows users will want to almost always just create a new
local branch that matches a remote branch.  In this type of workflow
it is handy to have the new branch dialog default to "Match Tracking
Branch" and "Starting Revision"-Tracking Branch", with the focus in
the branch filter field.  This can save users working on this type
of workflow at least two mouse clicks every time they create a new
local branch or switch to one with a fast-forward.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-08 21:12:54 -04:00
Shawn O. Pearce
7618e6b1c1 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>
2007-07-08 21:12:52 -04:00
Shawn O. Pearce
dd87efc8cc git-gui: Allow users to match remote branch names locally
Some workflows have users create a local branch that matches a remote
branch they have fetched from another repository.  If the user wants
to push their changes back to that remote repository then they probably
want to use the same branch name locally so that git-gui's push dialog
can setup the push refspec automatically.

To prevent typos with the local branch name we now offer an option to
use the remote tracking branch name as the new local branch name.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-08 21:12:50 -04:00
Shawn O. Pearce
79a060e477 git-gui: Maintain remote and source ref for tracking branches
In the next change I want to let the user create their local branch
name to match the remote branch name, so that the existing push
dialog can push the branch back up to the remote repository without
needing to do any sort of remapping.  To do that we need to know
exactly what branch name the remote system is using.

So all_tracking_branches returns a list of specifications, where
each specification is itself a list of:

  - local ref name (destination we fetch into)
  - remote name (repository we fetch from)
  - remote ref name (source ref we fetch from)

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-08 21:12:49 -04:00
Shawn O. Pearce
3206c63d0a git-gui: Refactor the delete branch dialog to use class system
A simple refactoring of the delete branch dialog to allow use of
the class construct to better organize the code and to reuse the
revision selection code of our new choose_rev mega-widget.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-08 21:12:47 -04:00
Shawn O. Pearce
b1fa2bfff3 git-gui: Abstract the revision picker into a mega widget
This rather large change pulls the "Starting Revision" part of the
new branch dialog into a mega widget that we can use anytime we
need to select a commit SHA-1.  To make use of the mega widget I
have also refactored the branch dialog to use the class system,
much like the delete remote branch dialog already does.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-08 21:12:46 -04:00