Permalink
Browse files

erge

  • Loading branch information...
2 parents 93c2e71 + 7f17149 commit 4bd70adc81e9e2d0481c685b9cc969145db8f602 @rubyredrick committed Aug 14, 2011
View
4 bash/aliases
@@ -104,7 +104,6 @@ alias cg='cd `gem environment gemdir`'
# database migrate
alias dbm='rake db:migrate'
-
# rails logs, tailing and cleaning
alias tdl='tail -f ./log/development.log'
alias ttl='tail -f ./log/test.log'
@@ -118,9 +117,6 @@ alias cg='cd `gem environment gemdir`'
alias mlmig='mateLastMigration'
alias dlmig="downLastMigration"
-# Ruby
- alias r='rake'
-
# gem
alias sgi='sudo gem install'
View
8 bash/env
@@ -32,13 +32,15 @@ fi
-export PATH="/usr/local/bin;/usr/local/sbin:"$PATH
+export PATH="/usr/local/bin:/usr/local/sbin:"$PATH
# export MANPATH="${MANPATH}:/opt/local/share/man"
-# export VISUALWORKS="/Users/rick/vw7.6nc"
-# export MAGLEV_HOME=/Users/rick/maglev
+# export VISUALWORKS="/Users/rickd/vw7.6nc"
+# export MAGLEV_HOME=/Users/rickd/maglev
# export PATH=$MAGLEV_HOME/bin:$PATH
# export PATH="/usr/local/mysql/bin:$PATH"
# export PATH="/usr/local/mongodb/bin:$PATH"
+export PATH="$PATH:/usr/local/msp430-toolchain/bin"
export EDITOR='mate -w'
export GIT_EDITOR='mate -w'
+export NODE_PATH='/usr/local/lib/node'
View
4 bash_profile
@@ -7,9 +7,9 @@
. ~/bin/dotfiles/bash/completions
##
-# Your previous /Users/rick/.bash_profile file was backed up as /Users/rick/.bash_profile.macports-saved_2009-12-06_at_11:56:31
+# Your previous /Users/rickd/.bash_profile file was backed up as /Users/rickd/.bash_profile.macports-saved_2009-12-06_at_11:56:31
##
# rvm-install added line:
-if [[ -s /Users/rick/.rvm/scripts/rvm ]] ; then source /Users/rick/.rvm/scripts/rvm ; fi
+if [[ -s /Users/rickd/.rvm/scripts/rvm ]] ; then source /Users/rickd/.rvm/scripts/rvm ; fi
View
3 bashrc
@@ -8,7 +8,8 @@ fi
. ~/bin/dotfiles/bash/env
. ~/bin/dotfiles/bash/aliases
+source ~/bin/dotfiles/git-flow-completion/git-flow-completion.bash
# rvm-install added line:
-if [[ -s /Users/rick/.rvm/scripts/rvm ]] ; then source /Users/rick/.rvm/scripts/rvm ; fi
+if [[ -s /Users/rickd/.rvm/scripts/rvm ]] ; then source /Users/rickd/.rvm/scripts/rvm ; fi
View
22 git-flow-completion/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2010 Justin Hileman
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
View
64 git-flow-completion/README.markdown
@@ -0,0 +1,64 @@
+git-flow-completion
+===================
+
+Bash and Zsh completion support for [git-flow](http://github.com/nvie/gitflow)
+
+The contained completion routines provide support for completing:
+
+ * git-flow init and version
+ * feature, hotfix and release branches
+ * remote feature, hotfix and release branch names
+
+
+Installation for Bash
+---------------------
+
+To achieve git-flow completion nirvana:
+
+ 0. [Install git-completion](http://github.com/bobthecow/git-flow-completion/wiki/Install-Bash-git-completion).
+
+ 1. Install this file. Either:
+
+ a. Place it in a `bash_completion.d` folder:
+
+ * /etc/bash_completion.d
+ * /usr/local/etc/bash_completion.d
+ * ~/bash_completion.d
+
+ b. Or, copy it somewhere (e.g. ~/.git-flow-completion.sh) and put the following line in
+ your .bashrc:
+
+ source ~/.git-flow-completion.sh
+
+ 2. If you are using Git < 1.7.1: Edit git-completion.sh and add the following line to the giant
+ $command case in _git:
+
+ flow) _git_flow ;;
+
+
+Installation for Zsh
+--------------------
+
+To achieve git-flow completion nirvana:
+
+ 0. Update your zsh's git-completion module to the newest verion --
+ [available here](http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD).
+
+ 1. Install this file. Either:
+
+ a. Place it in your .zshrc:
+
+ b. Or, copy it somewhere (e.g. ~/.git-flow-completion.zsh) and put the following line in
+ your .zshrc:
+
+ source ~/.git-flow-completion.zsh
+
+ c. Or, use this file as an oh-my-zsh plugin.
+
+
+The Fine Print
+--------------
+
+Copyright (c) 2010 [Justin Hileman](http://justinhileman.com)
+
+Distributed under the [MIT License](http://creativecommons.org/licenses/MIT/)
View
197 git-flow-completion/git-flow-completion.bash
@@ -0,0 +1,197 @@
+#!bash
+#
+# git-flow-completion
+# ===================
+#
+# Bash completion support for [git-flow](http://github.com/nvie/gitflow)
+#
+# The contained completion routines provide support for completing:
+#
+# * git-flow init and version
+# * feature, hotfix and release branches
+# * remote feature, hotfix and release branch names
+#
+#
+# Installation
+# ------------
+#
+# To achieve git-flow completion nirvana:
+#
+# 0. Install git-completion.
+#
+# 1. Install this file. Either:
+#
+# a. Place it in a `bash-completion.d` folder:
+#
+# * /etc/bash-completion.d
+# * /usr/local/etc/bash-completion.d
+# * ~/bash-completion.d
+#
+# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.sh) and put the following line in
+# your .bashrc:
+#
+# source ~/.git-flow-completion.sh
+#
+# 2. If you are using Git < 1.7.1: Edit git-completion.sh and add the following line to the giant
+# $command case in _git:
+#
+# flow) _git_flow ;;
+#
+#
+# The Fine Print
+# --------------
+#
+# Copyright (c) 2010 [Justin Hileman](http://justinhileman.com)
+#
+# Distributed under the [MIT License](http://creativecommons.org/licenses/MIT/)
+
+_git_flow ()
+{
+ local subcommands="init feature release hotfix help version"
+ local subcommand="$(__git_find_on_cmdline "$subcommands")"
+ if [ -z "$subcommand" ]; then
+ __gitcomp "$subcommands"
+ return
+ fi
+
+ case "$subcommand" in
+ init)
+ __git_flow_init
+ return
+ ;;
+ feature)
+ __git_flow_feature
+ return
+ ;;
+ release)
+ __git_flow_release
+ return
+ ;;
+ hotfix)
+ __git_flow_hotfix
+ return
+ ;;
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+}
+
+__git_flow_init ()
+{
+ local subcommands="help"
+ local subcommand="$(__git_find_on_cmdline "$subcommands")"
+ if [ -z "$subcommand" ]; then
+ __gitcomp "$subcommands"
+ return
+ fi
+}
+
+__git_flow_feature ()
+{
+ local subcommands="list start finish publish track diff rebase checkout pull help"
+ local subcommand="$(__git_find_on_cmdline "$subcommands")"
+ if [ -z "$subcommand" ]; then
+ __gitcomp "$subcommands"
+ return
+ fi
+
+ case "$subcommand" in
+ pull)
+ __gitcomp "$(__git_remotes)"
+ return
+ ;;
+ checkout|finish|diff|rebase)
+ __gitcomp "$(__git_flow_list_branches 'feature')"
+ return
+ ;;
+ publish)
+ __gitcomp "$(comm -23 <(__git_flow_list_branches 'feature') <(__git_flow_list_remote_branches 'feature'))"
+ return
+ ;;
+ track)
+ __gitcomp "$(comm -23 <(__git_flow_list_remote_branches 'feature') <(__git_flow_list_branches 'feature'))"
+ return
+ ;;
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+}
+
+__git_flow_release ()
+{
+ local subcommands="list start finish track publish help"
+ local subcommand="$(__git_find_on_cmdline "$subcommands")"
+ if [ -z "$subcommand" ]; then
+ __gitcomp "$subcommands"
+ return
+ fi
+
+ case "$subcommand" in
+ finish)
+ __gitcomp "$(__git_flow_list_branches 'release')"
+ return
+ ;;
+ publish)
+ __gitcomp "$(comm -23 <(__git_flow_list_branches 'release') <(__git_flow_list_remote_branches 'release'))"
+ return
+ ;;
+ track)
+ __gitcomp "$(comm -23 <(__git_flow_list_remote_branches 'release') <(__git_flow_list_branches 'release'))"
+ return
+ ;;
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+
+}
+
+__git_flow_hotfix ()
+{
+ local subcommands="list start finish help"
+ local subcommand="$(__git_find_on_cmdline "$subcommands")"
+ if [ -z "$subcommand" ]; then
+ __gitcomp "$subcommands"
+ return
+ fi
+
+ case "$subcommand" in
+ finish)
+ __gitcomp "$(__git_flow_list_branches 'hotfix')"
+ return
+ ;;
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+}
+
+__git_flow_prefix ()
+{
+ case "$1" in
+ feature|release|hotfix)
+ git config "gitflow.prefix.$1" 2> /dev/null || echo "$1/"
+ return
+ ;;
+ esac
+}
+
+__git_flow_list_branches ()
+{
+ local prefix="$(__git_flow_prefix $1)"
+ git branch 2> /dev/null | tr -d ' |*' | grep "^$prefix" | sed s,^$prefix,,
+}
+
+__git_flow_list_remote_branches ()
+{
+ local prefix="$(__git_flow_prefix $1)"
+ local origin="$(git config gitflow.origin 2> /dev/null || echo "origin")"
+ git branch -r 2> /dev/null | sed "s/^ *//g" | grep "^$origin/$prefix" | sed s,^$origin/$prefix,,
+}
+
+# alias __git_find_on_cmdline for backwards compatibility
+if [ -z "`type -t __git_find_on_cmdline`" ]; then
+ alias __git_find_on_cmdline=__git_find_subcommand
+fi
View
332 git-flow-completion/git-flow-completion.zsh
@@ -0,0 +1,332 @@
+#!zsh
+#
+# Installation
+# ------------
+#
+# To achieve git-flow completion nirvana:
+#
+# 0. Update your zsh's git-completion module to the newest verion.
+# From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD
+#
+# 1. Install this file. Either:
+#
+# a. Place it in your .zshrc:
+#
+# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.zsh) and put the following line in
+# your .zshrc:
+#
+# source ~/.git-flow-completion.zsh
+#
+# c. Or, use this file as a oh-my-zsh plugin.
+#
+
+_git-flow ()
+{
+ local curcontext="$curcontext" state line
+ typeset -A opt_args
+
+ _arguments -C \
+ ':command:->command' \
+ '*::options:->options'
+
+ case $state in
+ (command)
+
+ local -a subcommands
+ subcommands=(
+ 'init:Initialize a new git repo with support for the branching model.'
+ 'feature:Manage your feature branches.'
+ 'release:Manage your release branches.'
+ 'hotfix:Manage your hotfix branches.'
+ 'support:Manage your support branches.'
+ 'version:Shows version information.'
+ )
+ _describe -t commands 'git flow' subcommands
+ ;;
+
+ (options)
+ case $line[1] in
+
+ (init)
+ _arguments \
+ -f'[Force setting of gitflow branches, even if already configured]'
+ ;;
+
+ (version)
+ ;;
+
+ (hotfix)
+ __git-flow-hotfix
+ ;;
+
+ (release)
+ __git-flow-release
+ ;;
+
+ (feature)
+ __git-flow-feature
+ ;;
+ esac
+ ;;
+ esac
+}
+
+__git-flow-release ()
+{
+ local curcontext="$curcontext" state line
+ typeset -A opt_args
+
+ _arguments -C \
+ ':command:->command' \
+ '*::options:->options'
+
+ case $state in
+ (command)
+
+ local -a subcommands
+ subcommands=(
+ 'start:Start a new release branch.'
+ 'finish:Finish a release branch.'
+ 'list:List all your release branches. (Alias to `git flow release`)'
+ )
+ _describe -t commands 'git flow release' subcommands
+ _arguments \
+ -v'[Verbose (more) output]'
+ ;;
+
+ (options)
+ case $line[1] in
+
+ (start)
+ _arguments \
+ -F'[Fetch from origin before performing finish]'\
+ ':version:__git_flow_version_list'
+ ;;
+
+ (finish)
+ _arguments \
+ -F'[Fetch from origin before performing finish]' \
+ -s'[Sign the release tag cryptographically]'\
+ -u'[Use the given GPG-key for the digital signature (implies -s)]'\
+ -m'[Use the given tag message]'\
+ -p'[Push to $ORIGIN after performing finish]'\
+ ':version:__git_flow_version_list'
+ ;;
+
+ *)
+ _arguments \
+ -v'[Verbose (more) output]'
+ ;;
+ esac
+ ;;
+ esac
+}
+
+__git-flow-hotfix ()
+{
+ local curcontext="$curcontext" state line
+ typeset -A opt_args
+
+ _arguments -C \
+ ':command:->command' \
+ '*::options:->options'
+
+ case $state in
+ (command)
+
+ local -a subcommands
+ subcommands=(
+ 'start:Start a new hotfix branch.'
+ 'finish:Finish a hotfix branch.'
+ 'list:List all your hotfix branches. (Alias to `git flow hotfix`)'
+ )
+ _describe -t commands 'git flow hotfix' subcommands
+ _arguments \
+ -v'[Verbose (more) output]'
+ ;;
+
+ (options)
+ case $line[1] in
+
+ (start)
+ _arguments \
+ -F'[Fetch from origin before performing finish]'\
+ ':hotfix:__git_flow_version_list'\
+ ':branch-name:__git_branch_names'
+ ;;
+
+ (finish)
+ _arguments \
+ -F'[Fetch from origin before performing finish]' \
+ -s'[Sign the release tag cryptographically]'\
+ -u'[Use the given GPG-key for the digital signature (implies -s)]'\
+ -m'[Use the given tag message]'\
+ -p'[Push to $ORIGIN after performing finish]'\
+ ':hotfix:__git_flow_hotfix_list'
+ ;;
+
+ *)
+ _arguments \
+ -v'[Verbose (more) output]'
+ ;;
+ esac
+ ;;
+ esac
+}
+
+__git-flow-feature ()
+{
+ local curcontext="$curcontext" state line
+ typeset -A opt_args
+
+ _arguments -C \
+ ':command:->command' \
+ '*::options:->options'
+
+ case $state in
+ (command)
+
+ local -a subcommands
+ subcommands=(
+ 'start:Start a new feature branch.'
+ 'finish:Finish a feature branch.'
+ 'list:List all your feature branches. (Alias to `git flow feature`)'
+ 'publish: public'
+ 'track: track'
+ 'diff: diff'
+ 'rebase: rebase'
+ 'checkout: checkout'
+ 'pull: pull'
+ )
+ _describe -t commands 'git flow feature' subcommands
+ _arguments \
+ -v'[Verbose (more) output]'
+ ;;
+
+ (options)
+ case $line[1] in
+
+ (start)
+ _arguments \
+ -F'[Fetch from origin before performing finish]'\
+ ':feature:__git_flow_feature_list'\
+ ':branch-name:__git_branch_names'
+ ;;
+
+ (finish)
+ _arguments \
+ -F'[Fetch from origin before performing finish]' \
+ -r'[Rebase instead of merge]'\
+ ':feature:__git_flow_feature_list'
+ ;;
+
+ (publish)
+ _arguments \
+ ':feature:__git_flow_feature_list'\
+ ;;
+
+ (track)
+ _arguments \
+ ':feature:__git_flow_feature_list'\
+ ;;
+
+ (diff)
+ _arguments \
+ ':branch:__git_branch_names'\
+ ;;
+
+ (rebase)
+ _arguments \
+ -i'[Do an interactive rebase]' \
+ ':branch:__git_branch_names'
+ ;;
+
+ (checkout)
+ _arguments \
+ ':branch:__git_flow_feature_list'\
+ ;;
+
+ (pull)
+ _arguments \
+ ':remote:__git_remotes'\
+ ':branch:__git_branch_names'
+ ;;
+
+ *)
+ _arguments \
+ -v'[Verbose (more) output]'
+ ;;
+ esac
+ ;;
+ esac
+}
+
+__git_flow_version_list ()
+{
+ local expl
+ declare -a versions
+
+ versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}})
+ __git_command_successful || return
+
+ _wanted versions expl 'version' compadd $versions
+}
+
+__git_flow_feature_list ()
+{
+ local expl
+ declare -a features
+
+ features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}})
+ __git_command_successful || return
+
+ _wanted features expl 'feature' compadd $features
+}
+
+__git_remotes () {
+ local expl gitdir remotes
+
+ gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
+ __git_command_successful || return
+
+ remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
+ __git_command_successful || return
+
+ # TODO: Should combine the two instead of either or.
+ if (( $#remotes > 0 )); then
+ _wanted remotes expl remote compadd $* - $remotes
+ else
+ _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*"
+ fi
+}
+
+__git_flow_hotfix_list ()
+{
+ local expl
+ declare -a hotfixes
+
+ hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}})
+ __git_command_successful || return
+
+ _wanted hotfixes expl 'hotfix' compadd $hotfixes
+}
+
+__git_branch_names () {
+ local expl
+ declare -a branch_names
+
+ branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
+ __git_command_successful || return
+
+ _wanted branch-names expl branch-name compadd $* - $branch_names
+}
+
+__git_command_successful () {
+ if (( ${#pipestatus:#0} > 0 )); then
+ _message 'not a git repository'
+ return 1
+ fi
+ return 0
+}
+
+zstyle ':completion:*:*:git:*' user-commands flow:'description for foo'
View
1 zsh/config
@@ -39,6 +39,7 @@ HISTSIZE=10000
REPORTTIME=10 # Show elapsed time if command took more than X seconds
LISTMAX=0 # ask to complete if top of list would scroll off screen
+fpath=(~/bin/dotfiles/zsh/local_funcs $fpath)
# Load completions for Ruby, Git, etc.
autoload compinit
compinit
View
6,029 zsh/local_funcs/_git
6,029 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
4 zshrc
@@ -5,6 +5,8 @@
. ~/bin/dotfiles/bash/aliases
. ~/bin/dotfiles/zsh/config
+source ~/bin/dotfiles/git-flow-completion/git-flow-completion.zsh
+
# rvm-install added line:
-if [[ -s /Users/rick/.rvm/scripts/rvm ]] ; then source /Users/rick/.rvm/scripts/rvm ; fi
+if [[ -s /Users/rickd/.rvm/scripts/rvm ]] ; then source /Users/rickd/.rvm/scripts/rvm ; fi

0 comments on commit 4bd70ad

Please sign in to comment.