From 475fc8dbcf7b5b02adeb06b4ee89abf1f919797f Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 2 Jul 2013 12:42:15 +0200 Subject: [PATCH] Change base structure of repository --- .gitignore | 15 ++---- .gitmodules/antigen | 1 - .gitmodules/git-extras | 1 - .gitmodules/neobundle.vim | 1 - .gitmodules/rbenv | 1 - .zsh/10_env.zsh | 20 -------- NOTES.md | 2 + .ackrc => ackrc | 0 .autotest => autotest | 0 {.bin => bin}/bin | 0 {.bin => bin}/dotfiles | 11 ++--- {.bin => bin}/dotfiles.d/0_config.zsh | 0 {.bin => bin}/dotfiles.d/10_path.zsh | 0 {.bin => bin}/dotfiles.d/10_tools.zsh | 0 {.bin => bin}/dotfiles.d/50_osx.zsh | 0 {.bin => bin}/dotfiles.d/50_ubuntu.zsh | 0 {.bin => bin}/dotfiles.d/60_ruby.zsh | 0 {.bin => bin}/dotfiles.d/dotfiles.pack | 0 {.bin => bin}/hub | 48 +++++++++++-------- {.bin => bin}/ip | 0 {.bin => bin}/osx | 0 {.bin => bin}/rbenv | 0 {.bin => bin}/subl | 0 {.config => config}/powerline/config.json | 0 .../powerline/themes/vim/default.json | 0 .cvsignore => cvsignore | 0 .editrc => editrc | 0 .gemrc => gemrc | 0 {.getmail => getmail}/getmailrc | 0 .gitconfig => gitconfig | 1 + .hushlogin => hushlogin | 0 .irbrc => irbrc | 0 .pryrc => pryrc | 0 .rbenv => rbenv | 0 .rdebugrc => rdebugrc | 0 .tmux.conf => tmux | 0 .vimrc => vimrc | 8 ++++ .wgetrc => wgetrc | 0 zsh/10_env.zsh | 7 +++ {.zsh => zsh}/50_colors.zsh | 0 {.zsh => zsh}/50_zstyle.zsh | 0 {.zsh => zsh}/60_git.zsh | 0 {.zsh => zsh}/ctrl_z.zsh | 0 .zshenv => zshenv | 0 .zshrc => zshrc | 16 +++++++ 45 files changed, 68 insertions(+), 64 deletions(-) delete mode 160000 .gitmodules/antigen delete mode 160000 .gitmodules/git-extras delete mode 160000 .gitmodules/neobundle.vim delete mode 160000 .gitmodules/rbenv delete mode 100644 .zsh/10_env.zsh rename .ackrc => ackrc (100%) rename .autotest => autotest (100%) rename {.bin => bin}/bin (100%) rename {.bin => bin}/dotfiles (86%) rename {.bin => bin}/dotfiles.d/0_config.zsh (100%) rename {.bin => bin}/dotfiles.d/10_path.zsh (100%) rename {.bin => bin}/dotfiles.d/10_tools.zsh (100%) rename {.bin => bin}/dotfiles.d/50_osx.zsh (100%) rename {.bin => bin}/dotfiles.d/50_ubuntu.zsh (100%) rename {.bin => bin}/dotfiles.d/60_ruby.zsh (100%) rename {.bin => bin}/dotfiles.d/dotfiles.pack (100%) rename {.bin => bin}/hub (98%) rename {.bin => bin}/ip (100%) rename {.bin => bin}/osx (100%) rename {.bin => bin}/rbenv (100%) rename {.bin => bin}/subl (100%) rename {.config => config}/powerline/config.json (100%) rename {.config => config}/powerline/themes/vim/default.json (100%) rename .cvsignore => cvsignore (100%) rename .editrc => editrc (100%) rename .gemrc => gemrc (100%) rename {.getmail => getmail}/getmailrc (100%) rename .gitconfig => gitconfig (96%) rename .hushlogin => hushlogin (100%) rename .irbrc => irbrc (100%) rename .pryrc => pryrc (100%) rename .rbenv => rbenv (100%) rename .rdebugrc => rdebugrc (100%) rename .tmux.conf => tmux (100%) rename .vimrc => vimrc (95%) rename .wgetrc => wgetrc (100%) create mode 100644 zsh/10_env.zsh rename {.zsh => zsh}/50_colors.zsh (100%) rename {.zsh => zsh}/50_zstyle.zsh (100%) rename {.zsh => zsh}/60_git.zsh (100%) rename {.zsh => zsh}/ctrl_z.zsh (100%) rename .zshenv => zshenv (100%) rename .zshrc => zshrc (57%) diff --git a/.gitignore b/.gitignore index 1c338d8..86ce109 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,4 @@ -!bin/ -!link/.* -caches/ -backups/ -link/.ssh/authorized_keys -link/.ssh/id_* -link/.ssh/known_hosts -*LOCAL* -link/.vim/.* -.cache/ +cache/ +backup/ vim/bundle/ -home/.config/hub -*INBOX +config/hub diff --git a/.gitmodules/antigen b/.gitmodules/antigen deleted file mode 160000 index ce1316b..0000000 --- a/.gitmodules/antigen +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ce1316b685c0d9e9ac252230ac6f48b385083114 diff --git a/.gitmodules/git-extras b/.gitmodules/git-extras deleted file mode 160000 index d8492e6..0000000 --- a/.gitmodules/git-extras +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d8492e68eb70995b7e3967942b11818cd09aa350 diff --git a/.gitmodules/neobundle.vim b/.gitmodules/neobundle.vim deleted file mode 160000 index f21ad37..0000000 --- a/.gitmodules/neobundle.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f21ad37b29a8c29ff6d704cee0faaa6cf020d0c3 diff --git a/.gitmodules/rbenv b/.gitmodules/rbenv deleted file mode 160000 index 6d950de..0000000 --- a/.gitmodules/rbenv +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6d950dedf4bc630d14cce10256f6d1d25922c0f1 diff --git a/.zsh/10_env.zsh b/.zsh/10_env.zsh deleted file mode 100644 index e230d90..0000000 --- a/.zsh/10_env.zsh +++ /dev/null @@ -1,20 +0,0 @@ -# ensure /usr/local/bin has the highest precedence -export PATH=$HOME/.bin:$HOME/.python/bin:$PATH -export PATH=$PATH:$HOME/.dotfiles/libs/git-submodule-tools -export PATH=$PATH:$HOME/.dotfiles/lib/git-extras/bin -export PATH=$HOME/.cabal/bin:$PATH -export PATH=/usr/local/share/python:$PATH - -if [[ "$OSTYPE" =~ ^darwin ]]; then - export PATH="$(brew --prefix postgresql)/bin:$PATH" - export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" -fi -# Editing - -export EDITOR="vim" -export LESSOPEN="| src-hilite-lesspipe.sh %s" - -# By default, zsh considers many characters part of a word (e.g., _ and -). -# Narrow that down to allow easier skipping through words via M-f and M-b. -export WORDCHARS='*?[]~&;!$%^<>' - diff --git a/NOTES.md b/NOTES.md index 7b8b316..919a9a9 100644 --- a/NOTES.md +++ b/NOTES.md @@ -32,3 +32,5 @@ homebrew_recipes=( vim ssh-copy-id ctags mobile-shell ack source-highlight ) + +xquartz diff --git a/.ackrc b/ackrc similarity index 100% rename from .ackrc rename to ackrc diff --git a/.autotest b/autotest similarity index 100% rename from .autotest rename to autotest diff --git a/.bin/bin b/bin/bin similarity index 100% rename from .bin/bin rename to bin/bin diff --git a/.bin/dotfiles b/bin/dotfiles similarity index 86% rename from .bin/dotfiles rename to bin/dotfiles index 80c8101..23dab64 100755 --- a/.bin/dotfiles +++ b/bin/dotfiles @@ -24,14 +24,9 @@ link_dotfiles() { e_header "Linking files into home directory..." cd "$HOME" - for file in $DOTHOME/.*; do + for file in $DOTHOME/[a-z]*; do local base="$(basename $file)" - local dest="$HOME/$base" - - # Don't link .git directory - if test "$base" = ".git"; then - continue; - fi + local dest="$HOME/.$base" # Skip if link is the same. if test "$file" -ef "$dest"; then @@ -47,7 +42,7 @@ link_dotfiles() { mv "$dest" "$BACKDIR" fi - ln -sf "${file#$HOME/}" "$base" + ln -sf "${file#$HOME/}" ".$base" e_success "$base" done } diff --git a/.bin/dotfiles.d/0_config.zsh b/bin/dotfiles.d/0_config.zsh similarity index 100% rename from .bin/dotfiles.d/0_config.zsh rename to bin/dotfiles.d/0_config.zsh diff --git a/.bin/dotfiles.d/10_path.zsh b/bin/dotfiles.d/10_path.zsh similarity index 100% rename from .bin/dotfiles.d/10_path.zsh rename to bin/dotfiles.d/10_path.zsh diff --git a/.bin/dotfiles.d/10_tools.zsh b/bin/dotfiles.d/10_tools.zsh similarity index 100% rename from .bin/dotfiles.d/10_tools.zsh rename to bin/dotfiles.d/10_tools.zsh diff --git a/.bin/dotfiles.d/50_osx.zsh b/bin/dotfiles.d/50_osx.zsh similarity index 100% rename from .bin/dotfiles.d/50_osx.zsh rename to bin/dotfiles.d/50_osx.zsh diff --git a/.bin/dotfiles.d/50_ubuntu.zsh b/bin/dotfiles.d/50_ubuntu.zsh similarity index 100% rename from .bin/dotfiles.d/50_ubuntu.zsh rename to bin/dotfiles.d/50_ubuntu.zsh diff --git a/.bin/dotfiles.d/60_ruby.zsh b/bin/dotfiles.d/60_ruby.zsh similarity index 100% rename from .bin/dotfiles.d/60_ruby.zsh rename to bin/dotfiles.d/60_ruby.zsh diff --git a/.bin/dotfiles.d/dotfiles.pack b/bin/dotfiles.d/dotfiles.pack similarity index 100% rename from .bin/dotfiles.d/dotfiles.pack rename to bin/dotfiles.d/dotfiles.pack diff --git a/.bin/hub b/bin/hub similarity index 98% rename from .bin/hub rename to bin/hub index a17b573..34bc60e 100755 --- a/.bin/hub +++ b/bin/hub @@ -7,7 +7,7 @@ # module Hub - Version = VERSION = '1.10.4' + Version = VERSION = '1.10.6' end module Hub @@ -327,6 +327,7 @@ module Hub create_connection host_url end + req['User-Agent'] = "Hub #{Hub::VERSION}" apply_authentication(req, url) yield req if block_given? @@ -541,7 +542,7 @@ module Hub tty_state = `stty -g 2>#{NULL}` system 'stty raw -echo -icanon isig' if $?.success? pass = '' - while char = $stdin.getbyte and !(char == 13 or char == 10) + while char = getbyte($stdin) and !(char == 13 or char == 10) if char == 127 or char == 8 pass[-1,1] = '' unless pass.empty? else @@ -553,6 +554,14 @@ module Hub system "stty #{tty_state}" unless tty_state.empty? end + def getbyte(io) + if io.respond_to?(:getbyte) + io.getbyte + else + io.getc + end + end + def proxy_uri(with_ssl) env_name = "HTTP#{with_ssl ? 'S' : ''}_PROXY" if proxy = ENV[env_name] || ENV[env_name.downcase] and !proxy.empty? @@ -1190,7 +1199,7 @@ module Hub extend Context NAME_RE = /[\w.][\w.-]*/ - OWNER_RE = /[a-zA-Z0-9-]+/ + OWNER_RE = /[a-zA-Z0-9][a-zA-Z0-9-]*/ NAME_WITH_OWNER_RE = /^(?:#{NAME_RE}|#{OWNER_RE}\/#{NAME_RE})$/ CUSTOM_COMMANDS = %w[alias create browse compare fork pull-request] @@ -1230,6 +1239,10 @@ module Hub base_project = local_repo.main_project head_project = local_repo.current_project + unless current_branch + abort "Aborted: not currently on any branch." + end + unless base_project abort "Aborted: the origin remote doesn't point to a GitHub repository." end @@ -1331,13 +1344,18 @@ module Hub args.executable = 'echo' args.replace [pull['html_url']] rescue GitHubAPI::Exceptions - display_api_exception("creating pull request", $!.response) + response = $!.response + display_api_exception("creating pull request", response) + if 404 == response.status + base_url = base_project.web_url.split('://', 2).last + warn "Are you sure that #{base_url} exists?" + end exit 1 end def clone(args) ssh = args.delete('-p') - has_values = /^(--(upload-pack|template|depth|origin|branch|reference)|-[ubo])$/ + has_values = /^(--(upload-pack|template|depth|origin|branch|reference|name)|-[ubo])$/ idx = 1 while idx < args.length @@ -1362,17 +1380,7 @@ module Hub return unless index = args.index('add') args.delete_at index - branch = args.index('-b') || args.index('--branch') - if branch - args.delete_at branch - branch_name = args.delete_at branch - end - clone(args) - - if branch_name - args.insert branch, '-b', branch_name - end args.insert index, 'add' end @@ -1417,7 +1425,7 @@ module Hub end projects = names.map { |name| - unless name =~ /\W/ or remotes.include?(name) or remotes_group(name) + unless name !~ /^#{OWNER_RE}$/ or remotes.include?(name) or remotes_group(name) project = github_project(nil, name) repo_info = api_client.repo_info(project) if repo_info.success? @@ -1670,7 +1678,7 @@ module Hub abort "Usage: hub compare [USER] [...]" end else - sha_or_tag = /(\w{1,2}|\w[\w.-]+\w)/ + sha_or_tag = /((?:#{OWNER_RE}:)?\w[\w.-]+\w)/ range = args.pop.sub(/^#{sha_or_tag}\.\.#{sha_or_tag}$/, '\1...\2') project = if owner = args.pop then github_project(nil, owner) else current_project @@ -2061,7 +2069,7 @@ __END__ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "HUB" "1" "November 2012" "DEFUNKT" "Git Manual" +.TH "HUB" "1" "March 2013" "DEFUNKT" "Git Manual" . .SH "NAME" \fBhub\fR \- git + hub = github @@ -2485,8 +2493,8 @@ $ hub submodule add wycats/bundler vendor/bundler $ hub submodule add \-p wycats/bundler vendor/bundler > git submodule add git@github\.com:wycats/bundler\.git vendor/bundler -$ hub submodule add \-b ryppl ryppl/pip vendor/pip -> git submodule add \-b ryppl git://github\.com/ryppl/pip\.git vendor/pip +$ hub submodule add \-b ryppl \-\-name pip ryppl/pip vendor/pip +> git submodule add \-b ryppl \-\-name pip git://github\.com/ryppl/pip\.git vendor/pip . .fi . diff --git a/.bin/ip b/bin/ip similarity index 100% rename from .bin/ip rename to bin/ip diff --git a/.bin/osx b/bin/osx similarity index 100% rename from .bin/osx rename to bin/osx diff --git a/.bin/rbenv b/bin/rbenv similarity index 100% rename from .bin/rbenv rename to bin/rbenv diff --git a/.bin/subl b/bin/subl similarity index 100% rename from .bin/subl rename to bin/subl diff --git a/.config/powerline/config.json b/config/powerline/config.json similarity index 100% rename from .config/powerline/config.json rename to config/powerline/config.json diff --git a/.config/powerline/themes/vim/default.json b/config/powerline/themes/vim/default.json similarity index 100% rename from .config/powerline/themes/vim/default.json rename to config/powerline/themes/vim/default.json diff --git a/.cvsignore b/cvsignore similarity index 100% rename from .cvsignore rename to cvsignore diff --git a/.editrc b/editrc similarity index 100% rename from .editrc rename to editrc diff --git a/.gemrc b/gemrc similarity index 100% rename from .gemrc rename to gemrc diff --git a/.getmail/getmailrc b/getmail/getmailrc similarity index 100% rename from .getmail/getmailrc rename to getmail/getmailrc diff --git a/.gitconfig b/gitconfig similarity index 96% rename from .gitconfig rename to gitconfig index 61beba6..295f8a7 100644 --- a/.gitconfig +++ b/gitconfig @@ -10,6 +10,7 @@ br = branch co = checkout lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit + cp = cherry-pick [color] ui = true [push] diff --git a/.hushlogin b/hushlogin similarity index 100% rename from .hushlogin rename to hushlogin diff --git a/.irbrc b/irbrc similarity index 100% rename from .irbrc rename to irbrc diff --git a/.pryrc b/pryrc similarity index 100% rename from .pryrc rename to pryrc diff --git a/.rbenv b/rbenv similarity index 100% rename from .rbenv rename to rbenv diff --git a/.rdebugrc b/rdebugrc similarity index 100% rename from .rdebugrc rename to rdebugrc diff --git a/.tmux.conf b/tmux similarity index 100% rename from .tmux.conf rename to tmux diff --git a/.vimrc b/vimrc similarity index 95% rename from .vimrc rename to vimrc index 422744a..e5582c9 100644 --- a/.vimrc +++ b/vimrc @@ -20,6 +20,7 @@ call neobundle#config('vimproc', { \ 'unix' : 'make -f make_unix.mak', \ }, \ }) + NeoBundle 'christoomey/vim-space' NeoBundle 'chrisbra/NrrwRgn' NeoBundle 'vim-scripts/ZoomWin' @@ -93,8 +94,15 @@ NeoBundle 'skwp/vim-conque' NeoBundle 'duff/vim-bufonly' NeoBundle 'skwp/vim-ruby-conque' NeoBundle 'terryma/vim-multiple-cursors' +NeoBundle 'airblade/vim-gitgutter' +NeoBundle 'mattn/webapi-vim' +NeoBundle 'mattn/vdbi-vim' filetype plugin indent on NeoBundleCheck +" On OSX +vmap "+y +nmap "+p + runtime! plugin/vimrc.vim diff --git a/.wgetrc b/wgetrc similarity index 100% rename from .wgetrc rename to wgetrc diff --git a/zsh/10_env.zsh b/zsh/10_env.zsh new file mode 100644 index 0000000..9795e4e --- /dev/null +++ b/zsh/10_env.zsh @@ -0,0 +1,7 @@ +export EDITOR="vim" +export LESSOPEN="| src-hilite-lesspipe.sh %s" + +# By default, zsh considers many characters part of a word (e.g., _ and -). +# Narrow that down to allow easier skipping through words via M-f and M-b. +export WORDCHARS='*?[]~&;!$%^<>' + diff --git a/.zsh/50_colors.zsh b/zsh/50_colors.zsh similarity index 100% rename from .zsh/50_colors.zsh rename to zsh/50_colors.zsh diff --git a/.zsh/50_zstyle.zsh b/zsh/50_zstyle.zsh similarity index 100% rename from .zsh/50_zstyle.zsh rename to zsh/50_zstyle.zsh diff --git a/.zsh/60_git.zsh b/zsh/60_git.zsh similarity index 100% rename from .zsh/60_git.zsh rename to zsh/60_git.zsh diff --git a/.zsh/ctrl_z.zsh b/zsh/ctrl_z.zsh similarity index 100% rename from .zsh/ctrl_z.zsh rename to zsh/ctrl_z.zsh diff --git a/.zshenv b/zshenv similarity index 100% rename from .zshenv rename to zshenv diff --git a/.zshrc b/zshrc similarity index 57% rename from .zshrc rename to zshrc index 11f5d5a..99739f3 100644 --- a/.zshrc +++ b/zshrc @@ -18,3 +18,19 @@ antigen theme sheerun/oh-my-zsh-powerline-theme powerline antigen apply autoload -U zmv +:only() { + ps -ao pid,ppid,comm= | \ + awk '!'"/^$$|ack/&&/$(basename $SHELL)"'$/{print $2}' | \ + xargs kill +} + +if [[ "$SHELL" == *zsh ]]; then + zle -N :only + # bindkey "^Wo" :only + # bindkey "^W^O" :only +fi + + +### Added by the Heroku Toolbelt +export PATH="/usr/local/heroku/bin:$PATH" +export LANG="en_GB.UTF-8"