Browse files

use git's native plugin approach for git-wrapup

  • Loading branch information...
1 parent 52c8b03 commit e1d65a460998149b1cf05015babe468a18767043 @aaronj1335 committed Oct 14, 2013
Showing with 9 additions and 9 deletions.
  1. +8 −7 git-wrapup
  2. +1 −1 home_files/bashrc
  3. +0 −1 home_files/gitconfig
@@ -31,24 +31,25 @@ out pull requests to your local repo.
descriptive branch names can be long, so it's helpful to have command line
completion with this command. this is pretty easy if you're using bash and
you've already got git completion setup for bash. if you do, then add this
-script to your \$PATH, make it a git alias:
- $ git config --global alias.wrapup '!git-wrapup'
+script to your \$PATH (keep it named "git-wrapup" so "git wrapup" will work),
and then add this line to your bash startup script (~/.bashrc or whatever):
- if which git &>/dev/null && grep wrapup ~/.gitconfig &>/dev/null; then
+ if which git-wrapup &>/dev/null; then
_git_wrapup() { _git_branch; }
exit 70 # i guess this is the exit code for a documentatin request?
+current_branch="`git rev-parse --abbrev-ref HEAD`"
# default to using the current branch if none is given
if [ ! "$branch" ]; then
- branch="`git rev-parse --abbrev-ref HEAD`"
+ branch="$current_branch"
+if [ "$branch" = "$current_branch" ]; then
git checkout master
@@ -71,7 +72,7 @@ if [ "$remote" ]; then
# branches for this remote
git branch -dr $remote
perl -pi -e "s|^.*$remote.*\$||" "$gitconfig"
- perl -pi -e 's/^$//' "$gitconfig"
+ perl -pi -e 's/^\n//' "$gitconfig"
# we control this branch, so delete it on the remote
git push origin --delete $branch
@@ -161,7 +161,7 @@ fi
# if the system has git installed and i've got the 'wrapup' alias in my
# gitconfig, then define a completion function for it
-if which git &>/dev/null && grep wrapup ~/.gitconfig &>/dev/null; then
+if which git-wrapup &>/dev/null; then
_git_wrapup() { _git_branch; }
@@ -18,7 +18,6 @@
lga = !git log -n30 --graph --decorate --pretty=oneline --abbrev-commit --all && git status -sb
st = status -sb
stat = status -sb
- wrapup = !git-wrapup
name = Aaron Stacy

0 comments on commit e1d65a4

Please sign in to comment.