Staging
v0.8.1
https://github.com/git/git
Revision aa252f194b6a32240117ef339631f42842b6d5b4 authored by Shawn O. Pearce on 28 May 2007, 19:23:32 UTC, committed by Shawn O. Pearce on 28 May 2007, 21:50:42 UTC
Git has supported remote branch deletion for quite some time, but
I've just never gotten around to supporting it in git-gui.  Some
workflows have users push short-term branches to some remote Git
repository, then delete them a few days/weeks later when that topic
has been fully merged into the main trunk.  Typically in that style
of workflow the user will want to remove the branches they created.

We now offer a "Delete..." option in the Push menu, right below the
generic "Push..." option.  When the user opens our generic delete
dialog they can select a preconfigured remote, or enter a random
URL.  We run `git ls-remote $url` to obtain the list of branches and
tags known there, and offer this list in a listbox for the user to
select one or more from.

Like our local branch delete dialog we offer the user a way to filter
their selected branch list down to only those branches that have been
merged into another branch.  This is a very common operation as the
user will likely want to select a range of topic branches, but only
delete them if they have been merged into some sort of common trunk.

Unfortunately our remote merge base detection is not nearly as strict
as the local branch version.  We only offer remote heads as the test
commit (not any local ones) and we require that all necessary commits
to successfully run git-merge-base are available locally.  If one or
more is missing we suggest that the user run a fetch first.

Since the Git remote protocol doesn't let us specify what the tested
commit was when we evaluated our decision to execute the remote delete
there is a race condition here.  The user could do a merge test against
the trunk, determine a topic branch was fully merged, but before they
can start pushing the delete request another user could fast-forward
the remote topic branch to a new commit that is not merged into the
trunk.  The delete will arrive after, and remove the topic, even though
it was not fully merged.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
1 parent 61f82ce
History
Tip revision: aa252f194b6a32240117ef339631f42842b6d5b4 authored by Shawn O. Pearce on 28 May 2007, 19:23:32 UTC
git-gui: Allow users to delete remote branches
Tip revision: aa252f1
File Mode Size
lib
.gitignore -rw-r--r-- 62 bytes
GIT-VERSION-GEN -rwxr-xr-x 1.8 KB
Makefile -rw-r--r-- 3.5 KB
git-gui.sh -rwxr-xr-x 56.5 KB

back to top