1
0
mirror of https://github.com/git/git.git synced 2024-10-06 06:21:54 +02:00
Git Source Code Mirror. Please follow Documentation/SubmittingPatches procedure for any of your improvements.
Go to file
Shawn O. Pearce 61f82ce79a git-gui: Allow users to rename branches through 'branch -m'
Git's native command line interface has had branch renaming
support for quite a while, through the -m/-M options to the
git-branch command line tool.  This is an extremely useful
feature as users may decide that the name of their current
branch is not an adequate description, or was just entered
incorrectly when it was created.

Even though most people would consider git-branch to be a
Porcelain tool I'm using it here in git-gui as it is the
only code that implements the rather complex set of logic
needed to successfully rename a branch in Git.  Currently
that is along the lines of:

 *) Backup the ref
 *) Backup the reflog
 *) Delete the old ref
 *) Create the new ref
 *) Move the backed up reflog to the new ref
 *) Record the rename event in the reflog
 *) If the current branch was renamed, update HEAD
 *) If HEAD changed, record the rename event in the HEAD reflog
 *) Rename the [branch "$name"] section in the config file

Since that is some rather ugly set of functionality to implement
and get right, and some of it isn't easily accessible through the
raw plumbing layer I'm just cheating by relying on the Porcelain.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-28 17:50:42 -04:00
lib git-gui: Allow users to rename branches through 'branch -m' 2007-05-28 17:50:42 -04:00
.gitignore git-gui: Refactor into multiple files to save my sanity 2007-05-07 23:35:48 -04:00
git-gui.sh git-gui: Allow users to rename branches through 'branch -m' 2007-05-28 17:50:42 -04:00
GIT-VERSION-GEN git gui 0.8.0 2007-05-28 17:50:22 -04:00
Makefile git-gui: Guess our share/git-gui/lib path at runtime if possible 2007-05-27 00:03:37 -04:00