Unverified Commit 0232ac4b authored by Marc Cornellà's avatar Marc Cornellà Committed by GitHub
Browse files

Merge branch 'master' into master

parents afb02876 ebc700be
......@@ -4,7 +4,7 @@ Plugin for ForkLift, an FTP application for OS X.
### Requirements
* [ForkLift](http://www.binarynights.com/forklift/)
* [ForkLift](https://binarynights.com/)
### Usage
......
# Open folder in ForkLift.app or ForkLift2.app from console
# Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de
# Updated to support ForkLift2 by Johan Kaving
# Updated to support ForkLift 2 and ForkLift 3 by Johan Kaving
#
# Usage:
# fl [<folder>]
......@@ -26,21 +26,53 @@ function fl {
try
tell application "Finder"
set appName to name of application file id "com.binarynights.ForkLift2"
set forkLift3 to name of application file id "com.binarynights.ForkLift-3"
end tell
on error err_msg number err_num
set forkLift3 to null
end try
try
tell application "Finder"
set appName to name of application file id "com.binarynights.ForkLift"
set forkLift2 to name of application file id "com.binarynights.ForkLift2"
end tell
on error err_msg number err_num
set forkLift2 to null
end try
try
tell application "Finder"
set forkLift to name of application file id "com.binarynights.ForkLift"
end tell
on error err_msg number err_num
set forkLift to null
end try
if application appName is running
tell application appName
if forkLift3 is not null and application forkLift3 is running then
tell application forkLift3
activate
set forkLiftVersion to version
end tell
else if forkLift2 is not null and application forkLift2 is running then
tell application forkLift2
activate
set forkLiftVersion to version
end tell
else if forkLift is not null and application forkLift is running then
tell application forkLift
activate
set forkLiftVersion to version
end tell
else
if forkLift3 is not null then
set appName to forkLift3
else if forkLift2 is not null then
set appName to forkLift2
else if forkLift is not null then
set appName to forkLift
end if
tell application appName
activate
set forkLiftVersion to version
end tell
repeat until application appName is running
delay 1
......@@ -59,10 +91,16 @@ function fl {
set topWindow to window 1
end try
keystroke "g" using {command down, shift down}
if forkLiftVersion starts with "3" then
tell pop over of list of group of splitter group of splitter group of topWindow
set value of text field 1 to "$PWD"
end tell
else
tell sheet 1 of topWindow
set value of text field 1 to "$PWD"
keystroke return
end tell
end if
keystroke return
end tell
end tell
END
......
......@@ -32,16 +32,17 @@ Available search contexts are:
| context | URL |
|---------------|--------------------------------------------------------------------------|
| angularjs | `https://google.com/search?as_sitesearch=angularjs.org&as_q=` |
| angular(>=2.0)| `https://angular.io/?search=` |
| angularjs(1.x)| `https://google.com/search?as_sitesearch=angularjs.org&as_q=`
| aurajs | `http://aurajs.com/api/#stq=` |
| bem | `https://google.com/search?as_sitesearch=bem.info&as_q=` |
| bootsnipp | `http://bootsnipp.com/search?q=` |
| caniuse | `http://caniuse.com/#search=` |
| codepen | `http://codepen.io/search?q=` |
| bootsnipp | `https://bootsnipp.com/search?q=` |
| caniuse | `https://caniuse.com/#search=` |
| codepen | `https://codepen.io/search?q=` |
| compassdoc | `http://compass-style.org/search?q=` |
| cssflow | `http://www.cssflow.com/search?q=` |
| dartlang | `https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:` |
| emberjs | `http://emberjs.com/api/#stp=1&stq=` |
| emberjs | `https://emberjs.com/api/#stp=1&stq=` |
| fontello | `http://fontello.com/#search=` |
| html5please | `http://html5please.com/#` |
| jquery | `https://api.jquery.com/?s=` |
......@@ -51,7 +52,7 @@ Available search contexts are:
| qunit | `https://api.qunitjs.com/?s=` |
| reactjs | `https://google.com/search?as_sitesearch=facebook.github.io/react&as_q=` |
| smacss | `https://google.com/search?as_sitesearch=smacss.com&as_q=` |
| stackoverflow | `http://stackoverflow.com/search?q=` |
| stackoverflow | `https://stackoverflow.com/search?q=` |
| unheap | `http://www.unheap.com/?s=` |
If you want to have another context, open an Issue and tell us!
......@@ -62,4 +63,4 @@ If you want to have another context, open an Issue and tell us!
**Wilson Mendes (willmendesneto)**
+ <https://plus.google.com/+WilsonMendes>
+ <https://twitter.com/willmendesneto>
+ <http://github.com/willmendesneto>
+ <https://github.com/willmendesneto>
......@@ -33,7 +33,8 @@ function _frontend() {
'unheap: Search in unheap website'
'bem: Search in BEM website'
'smacss: Search in SMACSS website'
'angularjs: Search in Angular website'
'angular: Search in Angular website for Angular 2.x'
'angularjs: Search in Angular website for Angular 1.x'
'reactjs: Search in React website'
'emberjs: Search in Ember website'
'stackoverflow: Search in StackOverflow website'
......@@ -99,6 +100,9 @@ function _frontend() {
smacss)
_describe -t points "Warp points" frontend_points && ret=0
;;
angular)
_describe -t points "Warp points" frontend_points && ret=0
;;
angularjs)
_describe -t points "Warp points" frontend_points && ret=0
;;
......
alias angular='frontend angular'
alias angularjs='frontend angularjs'
alias aurajs='frontend aurajs'
alias bem='frontend bem'
......@@ -26,16 +27,17 @@ function frontend() {
# define search context URLS
typeset -A urls
urls=(
angular 'https://angular.io/?search='
angularjs 'https://google.com/search?as_sitesearch=angularjs.org&as_q='
aurajs 'http://aurajs.com/api/#stq='
bem 'https://google.com/search?as_sitesearch=bem.info&as_q='
bootsnipp 'http://bootsnipp.com/search?q='
caniuse 'http://caniuse.com/#search='
codepen 'http://codepen.io/search?q='
bootsnipp 'https://bootsnipp.com/search?q='
caniuse 'https://caniuse.com/#search='
codepen 'https://codepen.io/search?q='
compassdoc 'http://compass-style.org/search?q='
cssflow 'http://www.cssflow.com/search?q='
dartlang 'https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:'
emberjs 'http://emberjs.com/api/#stp=1&stq='
emberjs 'https://emberjs.com/api/#stp=1&stq='
fontello 'http://fontello.com/#search='
html5please 'http://html5please.com/#'
jquery 'https://api.jquery.com/?s='
......@@ -45,7 +47,7 @@ function frontend() {
qunit 'https://api.qunitjs.com/?s='
reactjs 'https://google.com/search?as_sitesearch=facebook.github.io/react&as_q='
smacss 'https://google.com/search?as_sitesearch=smacss.com&as_q='
stackoverflow 'http://stackoverflow.com/search?q='
stackoverflow 'https://stackoverflow.com/search?q='
unheap 'http://www.unheap.com/?s='
)
......@@ -57,9 +59,9 @@ function frontend() {
print -P "%Uterm%u and what follows is what will be searched for in the %Ucontext%u website,"
print -P "and %Ucontext%u is one of the following:"
print -P ""
print -P " angularjs, aurajs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow,"
print -P " dartlang, emberjs, fontello, html5please, jquery, lodash, mdn, npmjs,"
print -P " qunit, reactjs, smacss, stackoverflow, unheap"
print -P " angular (>= 2.0), angularjs (1.x), aurajs, bem, bootsnipp, caniuse, codepen,"
print -P " compassdoc, cssflow, dartlang, emberjs, fontello, html5please, jquery,"
print -P " lodash, mdn, npmjs, qunit, reactjs, smacss, stackoverflow, unheap"
print -P ""
print -P "For example: frontend npmjs mocha (or just: npmjs mocha)."
print -P ""
......@@ -73,17 +75,17 @@ function frontend() {
echo ""
echo "Valid contexts are:"
echo ""
echo " angularjs, aurajs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow, "
echo " dartlang, emberjs, fontello, html5please, jquery, lodash, mdn, npmjs, "
echo " qunit, reactjs, smacss, stackoverflow, unheap"
echo " angular (>= 2.0), angularjs (1.x), aurajs, bem, bootsnipp, caniuse, codepen,"
echo " compassdoc, cssflow, dartlang, emberjs, fontello, html5please, jquery,"
echo " lodash, mdn, npmjs, qunit, reactjs, smacss, stackoverflow, unheap"
echo ""
return 1
fi
# build search url:
# join arguments passed with '+', then append to search context URL
# join arguments passed with '%20', then append to search context URL
# TODO substitute for proper urlencode method
url="${urls[$1]}${(j:+:)@[2,-1]}"
url="${urls[$1]}${(j:%20:)@[2,-1]}"
echo "Opening $url ..."
......
# fzf
This plugin enables [junegunn's fzf](https://github.com/junegunn/fzf) fuzzy auto-completion and key bindings
```zsh
# Set fzf installation directory path
export FZF_BASE=/path/to/fzf/install/dir
# Uncomment the following line to disable fuzzy completion
# export DISABLE_FZF_AUTO_COMPLETION="true"
# Uncomment the following line to disable key bindings (CTRL-T, CTRL-R, ALT-C)
# export DISABLE_FZF_KEY_BINDINGS="true"
plugins=(
...
fzf
)
```
test -d "${FZF_BASE}" && fzf_base="${FZF_BASE}"
if [[ -z "${fzf_base}" ]]; then
fzfdirs=(
"${HOME}/.fzf"
"/usr/local/opt/fzf"
"/usr/share/fzf"
)
for dir in ${fzfdirs}; do
if [[ -d "${dir}" ]]; then
fzf_base="${dir}"
break
fi
done
if [[ -z "${fzf_base}" ]]; then
if (( ${+commands[brew]} )) && dir="$(brew --prefix fzf 2>/dev/null)"; then
if [[ -d "${dir}" ]]; then
fzf_base="${dir}"
fi
fi
fi
fi
if [[ -n "${fzf_base}" ]]; then
# Fix fzf shell directory for Archlinux package
if [[ ! -d "${fzf_base}/shell" ]] && [[ -f /etc/arch-release ]]; then
fzf_shell="${fzf_base}"
else
fzf_shell="${fzf_base}/shell"
fi
# Setup fzf
# ---------
if ! (( ${+commands[fzf]} )) && [[ ! "$PATH" == *$fzf_base/bin* ]]; then
export PATH="$PATH:$fzf_base/bin"
fi
# Auto-completion
# ---------------
if [[ ! "$DISABLE_FZF_AUTO_COMPLETION" == "true" ]]; then
[[ $- == *i* ]] && source "${fzf_shell}/completion.zsh" 2> /dev/null
fi
# Key bindings
# ------------
if [[ ! "$DISABLE_FZF_KEY_BINDINGS" == "true" ]]; then
source "${fzf_shell}/key-bindings.zsh"
fi
else
print "[oh-my-zsh] fzf plugin: Cannot find fzf installation directory.\n"\
"Please add \`export FZF_BASE=/path/to/fzf/install/dir\` to your .zshrc" >&2
fi
unset fzf_base fzf_shell dir fzfdirs
## ZSH-Geeknote
[Geeknote](https://github.com/VitaliyRodnenko/geeknote) plugin for [oh-my-zsh framework](http://github.com/robbyrussell/oh-my-zsh).
[Geeknote](https://github.com/VitaliyRodnenko/geeknote) plugin for oh-my-zsh.
Plugins provides:
......
# Gem plugin
This plugin adds completions and aliases for [Gem](https://rubygems.org/). The completions include the common `gem` subcommands as well as the installed gems in the current directory.
To use it, add `gem` to the plugins array in your zshrc file:
```zsh
plugins=(... gem)
```
## Aliases
| Alias | Command | Description |
|----------------------|-------------------------------|--------------------------------------------|
| gemb | `gem build *.gemspec` | Build a gem from a gemspec |
| gemp | `gem push *.gem` | Push a gem up to the gem server |
| gemy [gem] [version] | `gem yank [gem] -v [version]` | Remove a pushed gem version from the index |
# Git auto-fetch
Automatically fetches all changes from all remotes while you are working in git-initialized directory.
#### Usage
Add `git-auto-fetch` to the plugins array in your zshrc file:
```shell
plugins=(... git-auto-fetch)
```
Every time you launch a command in your shell all remotes will be fetched in background.
By default autofetch will be triggered only if last fetch was done at least 60 seconds ago.
You can change fetch interval in your .zshrc:
```
GIT_AUTO_FETCH_INTERVAL=1200 #in seconds
```
Log of `git fetch --all` will be saved into `.git/FETCH_LOG`
#### Toggle auto fetch per folder
If you are using mobile connection or for any other reason you can disable git-auto-fetch for any folder:
```shell
$ cd to/your/project
$ git-auto-fetch
disabled
$ git-auto-fetch
enabled
```
GIT_AUTO_FETCH_INTERVAL=${GIT_AUTO_FETCH_INTERVAL:=60}
function git-fetch-all {
(`git rev-parse --is-inside-work-tree 2>/dev/null` &&
dir=`git rev-parse --git-dir` &&
[[ ! -f $dir/NO_AUTO_FETCH ]] &&
(( `date +%s` - `date -r $dir/FETCH_LOG +%s 2>/dev/null || echo 0` > $GIT_AUTO_FETCH_INTERVAL )) &&
git fetch --all &>! $dir/FETCH_LOG &)
}
function git-auto-fetch {
`git rev-parse --is-inside-work-tree 2>/dev/null` || return
guard="`git rev-parse --git-dir`/NO_AUTO_FETCH"
(rm $guard 2>/dev/null &&
echo "${fg_bold[green]}enabled${reset_color}") ||
(touch $guard &&
echo "${fg_bold[red]}disabled${reset_color}")
}
eval "override-git-auto-fetch-$(declare -f zle-line-init)"
function zle-line-init () {
git-fetch-all
override-git-auto-fetch-zle-line-init
}
zle -N zle-line-init
# git-extras
This plugin provides completion definitions for some of the commands defined by [git-extras](http://github.com/tj/git-extras).
This plugin provides completion definitions for some of the commands defined by [git-extras](https://github.com/tj/git-extras).
## Setup notes
......
......@@ -2,7 +2,7 @@
# Description
# -----------
#
# Completion script for git-extras (http://github.com/tj/git-extras).
# Completion script for git-extras (https://github.com/tj/git-extras).
#
# This depends on and reuses some of the internals of the _git completion
# function that ships with zsh itself. It will not work with the _git that ships
......@@ -19,8 +19,8 @@
# Inspirations
# -----------
#
# * git-extras (http://github.com/tj/git-extras)
# * git-flow-completion (http://github.com/bobthecow/git-flow-completion)
# * git-extras (https://github.com/tj/git-extras)
# * git-flow-completion (https://github.com/bobthecow/git-flow-completion)
#
# ------------------------------------------------------------------------------
......@@ -47,6 +47,14 @@ __gitex_commits() {
_describe -t commits commit commits && ret=0
}
__gitex_remote_names() {
local expl
declare -a remote_names
remote_names=(${(f)"$(_call_program remotes git remote 2>/dev/null)"})
__git_command_successful || return
_wanted remote-names expl remote-name compadd $* - $remote_names
}
__gitex_tag_names() {
local expl
declare -a tag_names
......@@ -69,7 +77,11 @@ __gitex_specific_branch_names() {
declare -a branch_names
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/"$1" 2>/dev/null)"}#refs/heads/$1/})
__git_command_successful || return
_wanted branch-names expl branch-name compadd $* - $branch_names
_wanted branch-names expl branch-name compadd - $branch_names
}
__gitex_chore_branch_names() {
__gitex_specific_branch_names 'chore'
}
__gitex_feature_branch_names() {
......@@ -102,6 +114,11 @@ __gitex_author_names() {
}
# subcommands
_git-authors() {
_arguments -C \
'(--list -l)'{--list,-l}'[show authors]' \
'--no-email[without email]' \
}
_git-bug() {
local curcontext=$curcontext state line ret=1
......@@ -126,8 +143,16 @@ _git-bug() {
_arguments -C \
':branch-name:__gitex_bug_branch_names'
;;
-r|--remote )
_arguments -C \
':remote-name:__gitex_remote_names'
;;
esac
return 0
esac
_arguments \
'(--remote -r)'{--remote,-r}'[setup remote tracking branch]'
}
......@@ -136,6 +161,40 @@ _git-changelog() {
'(-l --list)'{-l,--list}'[list commits]' \
}
_git-chore() {
local curcontext=$curcontext state line ret=1
declare -A opt_args
_arguments -C \
': :->command' \
'*:: :->option-or-argument' && ret=0
case $state in
(command)
declare -a commands
commands=(
'finish:merge and delete the chore branch'
)
_describe -t commands command commands && ret=0
;;
(option-or-argument)
curcontext=${curcontext%:*}-$line[1]:
case $line[1] in
(finish)
_arguments -C \
':branch-name:__gitex_chore_branch_names'
;;
-r|--remote )
_arguments -C \
':remote-name:__gitex_remote_names'
;;
esac
return 0
esac
_arguments \
'(--remote -r)'{--remote,-r}'[setup remote tracking branch]'
}
_git-contrib() {
......@@ -149,6 +208,27 @@ _git-count() {
'--all[detailed commit count]'
}
_git-create-branch() {
local curcontext=$curcontext state line
_arguments -C \
': :->command' \
'*:: :->option-or-argument'
case "$state" in
(command)
_arguments \
'(--remote -r)'{--remote,-r}'[setup remote tracking branch]'
;;
(option-or-argument)
curcontext=${curcontext%:*}-$line[1]:
case $line[1] in
-r|--remote )
_arguments -C \
':remote-name:__gitex_remote_names'
;;
esac
esac
}
_git-delete-branch() {
_arguments \
......@@ -220,10 +300,17 @@ _git-feature() {
_arguments -C \
':branch-name:__gitex_feature_branch_names'
;;
-r|--remote )
_arguments -C \
':remote-name:__gitex_remote_names'
;;
esac
return 0
esac
}
_arguments \
'(--remote -r)'{--remote,-r}'[setup remote tracking branch]'
}
_git-graft() {
_arguments \
......@@ -231,14 +318,39 @@ _git-graft() {
':dest-branch-name:__gitex_branch_names'
}
_git-guilt() {
_arguments -C \
'(--email -e)'{--email,-e}'[display author emails instead of names]' \
'(--ignore-whitespace -w)'{--ignore-whitespace,-w}'[ignore whitespace only changes]' \
'(--debug -d)'{--debug,-d}'[output debug information]' \
'-h[output usage information]'
}
_git-ignore() {
_arguments -C \
'(--local -l)'{--local,-l}'[show local gitignore]' \
'(--global -g)'{--global,-g}'[show global gitignore]'
'(--global -g)'{--global,-g}'[show global gitignore]' \
'(--private -p)'{--private,-p}'[show repo gitignore]'
}
_git-ignore() {
_arguments -C \
'(--append -a)'{--append,-a}'[append .gitignore]' \
'(--replace -r)'{--replace,-r}'[replace .gitignore]' \
'(--list-in-table -l)'{--list-in-table,-l}'[print available types in table format]' \
'(--list-alphabetically -L)'{--list-alphabetically,-L}'[print available types in alphabetical order]' \
'(--search -s)'{--search,-s}'[search word in available types]'
}
_git-merge-into() {
_arguments '--ff-only[merge only fast-forward]'
_arguments \
':src:__gitex_branch_names' \
':dest:__gitex_branch_names'
}
_git-missing() {
_arguments \
':first-branch-name:__gitex_branch_names' \
......@@ -269,8 +381,16 @@ _git-refactor() {
_arguments -C \
':branch-name:__gitex_refactor_branch_names'
;;
-r|--remote )
_arguments -C \
':remote-name:__gitex_remote_names'
;;
esac
return 0
esac
_arguments \
'(--remote -r)'{--remote,-r}'[setup remote tracking branch]'
}
......@@ -279,6 +399,23 @@ _git-squash() {
':branch-name:__gitex_branch_names'
}
_git-stamp() {
_arguments -C \
'(--replace -r)'{--replace,-r}'[replace stamps with same id]'
}
_git-standup() {
_arguments -C \
'-a[Specify the author of commits. Use "all" to specify all authors.]' \
'-d[Show history since N days ago]' \
'-D[Specify the date format displayed in commit history]' \
'-f[Fetch commits before showing history]' \
'-g[Display GPG signed info]' \
'-h[Display help message]' \
'-L[Enable the inclusion of symbolic links]' \
'-m[The depth of recursive directory search]'
}
_git-summary() {
_arguments '--line[summarize with lines rather than commits]'
__gitex_commits
......@@ -291,45 +428,71 @@ _git-undo(){
'(--hard -h)'{--hard,-h}'[wipes your commit(s)]'
}
zstyle ':completion:*:*:git:*' user-commands \
zstyle -g existing_user_commands ':completion:*:*:git:*' user-commands
zstyle ':completion:*:*:git:*' user-commands $existing_user_commands \
alias:'define, search and show aliases' \
archive-file:'export the current HEAD of the git repository to a archive' \
archive-file:'export the current head of the git repository to an archive' \
authors:'generate authors report' \
back:'undo and stage latest commits' \
bug:'create a bug branch' \
changelog:'populate changelog file with commits since the previous tag' \
commits-since:'list commits since a given date' \
contrib:'display author contributions' \
count:'count commits' \
create-branch:'create local and remote branch' \
delete-branch:'delete local and remote branch' \
delete-merged-branches:'delete merged branches'\
delete-submodule:'delete submodule' \
delete-tag:'delete local and remote tag' \
effort:'display effort statistics' \
extras:'git-extras' \
feature:'create a feature branch' \
fork:'fork a repo on github' \
fresh-branch:'create empty local branch' \
gh-pages:'create the GitHub Pages branch' \
graft:'merge commits from source branch to destination branch' \
ignore:'add patterns to .gitignore' \
info:'show info about the repository' \
local-commits:'list unpushed commits on the local branch' \
bug:'create bug branch' \
bulk:'run bulk commands' \
changelog:'generate a changelog report' \
chore:'create chore branch' \
clear-soft:'soft clean up a repository' \
clear:'rigorously clean up a repository' \
commits-since:'show commit logs since some date' \
contrib:'show user contributions' \
count:'show commit count' \
create-branch:'create branches' \
delete-branch:'delete branches' \
delete-merged-branches:'delete merged branches' \
delete-submodule:'delete submodules' \
delete-tag:'delete tags' \
delta:'lists changed files' \
effort:'show effort statistics on file(s)' \
extras:'awesome git utilities' \
feature:'create/merge feature branch' \
force-clone:'overwrite local repositories with clone' \
fork:'fork a repo on GitHub' \
fresh-branch:'create fresh branches' \
gh-pages:'create the GitHub pages branch' \
graft:'merge and destroy a given branch' \
guilt:'calculate change between two revisions' \
ignore-io:'get sample gitignore file' \
ignore:'add .gitignore patterns' \
info:'returns information on current repository' \
local-commits:'list local commits' \
lock:'lock a file excluded from version control' \
locked:'ls files that have been locked' \
merge-into:'merge one branch into another' \
merge-repo:'merge two repo histories' \
missing:'show commits missing from another branch' \
mr:'checks out a merge request locally' \
obliterate:'rewrite past commits to remove some files' \
pr:'checks out a pull request locally' \
psykorebase:'rebase a branch with a merge commit' \
pull-request:'create pull request to GitHub project' \
reauthor:'replace the author and/or committer identities in commits and tags' \
rebase-patch:'rebases a patch' \
refactor:'create a refactor branch' \
refactor:'create refactor branch' \
release:'commit, tag and push changes to the repository' \
rename-branch:'rename a branch' \
rename-tag:'rename a tag' \
repl:'read-eval-print-loop' \
repl:'git read-eval-print-loop' \
reset-file:'reset one file' \
root:'show path of root' \
setup:'setup a git repository' \
scp:'copy files to ssh compatible `git-remote`' \
sed:'replace patterns in git-controlled files' \
setup:'set up a git repository' \
show-merged-branches:'show merged branches' \
show-tree:'show branch tree of commit history' \
squash:'merge commits from source branch into the current one as a single commit' \
summary:'repository summary' \
touch:'one step creation of new files' \
undo:'remove the latest commit' \
show-unmerged-branches:'show unmerged branches' \
squash:'import changes from a branch' \
stamp:'stamp the last commit message' \
standup:'recall the commit history' \
summary:'show repository summary' \
sync:'sync local branch with remote branch' \
touch:'touch and add file to the index' \
undo:'remove latest commits' \
unlock:'unlock a file excluded from version control'
# git-flow (AVH Edition) plugin
This plugin adds completion for the [git-flow (AVH Edition)](https://github.com/petervanderdoes/gitflow-avh).
The AVH Edition of the git extensions that provides high-level repository operations for [Vincent Driessen's branching model](https://nvie.com/posts/a-successful-git-branching-model/).
To use it, add `git-flow-avh` to the plugins array in your zshrc file:
```zsh
plugins=(... git-flow-avh)
```
## Requirements
1. The git-flow tool has to be [installed](https://github.com/petervanderdoes/gitflow-avh#installing-git-flow)
separately.
2. You have to use zsh's git completion instead of the git project's git completion. This is typically
done by default so you don't need to do anything else. If you installed git with Homebrew you
might have to uninstall the git completion it's bundled with.
#!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
......@@ -36,6 +14,7 @@ _git-flow ()
subcommands=(
'init:Initialize a new git repo with support for the branching model.'
'feature:Manage your feature branches.'
'bugfix:Manage your bugfix branches.'
'config:Manage your configuration.'
'release:Manage your release branches.'
'hotfix:Manage your hotfix branches.'
......@@ -44,6 +23,7 @@ _git-flow ()
'finish:Finish the branch you are currently on.'
'delete:Delete the branch you are currently on.'
'publish:Publish the branch you are currently on.'
'rebase:Rebase the branch you are currently on.'
)
_describe -t commands 'git flow' subcommands
;;
......@@ -70,6 +50,10 @@ _git-flow ()
(feature)
__git-flow-feature
;;
(bugfix)
__git-flow-bugfix
;;
(config)
__git-flow-config
;;
......@@ -98,6 +82,7 @@ __git-flow-release ()
'list:List all your release branches. (Alias to `git flow release`)'
'publish:Publish release branch to remote.'
'track:Checkout remote release branch.'
'rebase:Rebase from integration branch.'
'delete:Delete a release branch.'
)
_describe -t commands 'git flow release' subcommands
......@@ -141,6 +126,12 @@ __git-flow-release ()
':version:__git_flow_version_list'
;;
(rebase)
_arguments \
-i'[Do an interactive rebase]' \
':branch:__git_branch_names'
;;
*)
_arguments \
-v'[Verbose (more) output]'
......@@ -167,7 +158,9 @@ __git-flow-hotfix ()
'start:Start a new hotfix branch.'
'finish:Finish a hotfix branch.'
'delete:Delete a hotfix branch.'
'rebase:Rebase from integration branch.'
'list:List all your hotfix branches. (Alias to `git flow hotfix`)'
'rename:Rename a hotfix branch.'
)
_describe -t commands 'git flow hotfix' subcommands
_arguments \
......@@ -201,6 +194,12 @@ __git-flow-hotfix ()
':hotfix:__git_flow_hotfix_list'
;;
(rebase)
_arguments \
-i'[Do an interactive rebase]' \
':branch:__git_branch_names'
;;
*)
_arguments \
-v'[Verbose (more) output]'
......@@ -234,6 +233,7 @@ __git-flow-feature ()
'rebase:Rebase from integration branch.'
'checkout:Checkout local feature branch.'
'pull:Pull changes from remote.'
'rename:Rename a feature branch.'
)
_describe -t commands 'git flow feature' subcommands
_arguments \
......@@ -305,6 +305,102 @@ __git-flow-feature ()
esac
}
__git-flow-bugfix ()
{
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 bugfix branch.'
'finish:Finish a bugfix branch.'
'delete:Delete a bugfix branch.'
'list:List all your bugfix branches. (Alias to `git flow bugfix`)'
'publish:Publish bugfix branch to remote.'
'track:Checkout remote bugfix branch.'
'diff:Show all changes.'
'rebase:Rebase from integration branch.'
'checkout:Checkout local bugfix branch.'
'pull:Pull changes from remote.'
'rename:Rename a bugfix branch.'
)
_describe -t commands 'git flow bugfix' subcommands
_arguments \
-v'[Verbose (more) output]'
;;
(options)
case $line[1] in
(start)
_arguments \
-F'[Fetch from origin before performing finish]'\
':bugfix:__git_flow_bugfix_list'\
':branch-name:__git_branch_names'
;;
(finish)
_arguments \
-F'[Fetch from origin before performing finish]' \
-r'[Rebase instead of merge]'\
':bugfix:__git_flow_bugfix_list'
;;
(delete)
_arguments \
-f'[Force deletion]' \
-r'[Delete remote branch]' \
':bugfix:__git_flow_bugfix_list'
;;
(publish)
_arguments \
':bugfix:__git_flow_bugfix_list'\
;;
(track)
_arguments \
':bugfix:__git_flow_bugfix_list'\
;;
(diff)
_arguments \
':branch:__git_branch_names'\
;;
(rebase)
_arguments \
-i'[Do an interactive rebase]' \
':branch:__git_branch_names'
;;
(checkout)
_arguments \
':branch:__git_flow_bugfix_list'\
;;
(pull)
_arguments \
':remote:__git_remotes'\
':branch:__git_branch_names'
;;
*)
_arguments \
-v'[Verbose (more) output]'
;;
esac
;;
esac
}
__git-flow-config ()
{
local curcontext="$curcontext" state line
......@@ -370,6 +466,17 @@ __git_flow_feature_list ()
_wanted features expl 'feature' compadd $features
}
__git_flow_bugfix_list ()
{
local expl
declare -a bugfixes
bugfixes=(${${(f)"$(_call_program bugfixes git flow bugfix list 2> /dev/null | tr -d ' |*')"}})
__git_command_successful || return
_wanted bugfixes expl 'bugfix' compadd $bugfixes
}
__git_remotes () {
local expl gitdir remotes
......
......@@ -14,7 +14,7 @@ More information about `git-flow` commands:
https://github.com/nvie/gitflow/wiki/Command-Line-Arguments
| Alias | Command | Description |
|---------|---------------------------|----------------------------------------|
|---------|----------------------------|----------------------------------------|
| `gfl` | `git flow` | Git-Flow command |
| `gfli` | `git flow init` | Initialize git-flow repository |
| `gcd` | `git checkout develop` | Check out develop branch |
......@@ -27,5 +27,6 @@ https://github.com/nvie/gitflow/wiki/Command-Line-Arguments
| `gflhs` | `git flow hotfix start` | Start a new hotfix: `gflhs <version>` |
| `gflrs` | `git flow release start` | Start a new release: `gflrs <version>` |
| `gflff` | `git flow feature finish` | Finish feature: `gflff <name>` |
| `gflfp` | `git flow feature publish` | Publish feature: `gflfp <name>` |
| `gflhf` | `git flow hotfix finish` | Finish hotfix: `gflhf <version>` |
| `gflrf` | `git flow release finish` | Finish release: `gflrf <version>` |
......@@ -33,6 +33,7 @@ alias gflfs='git flow feature start'
alias gflhs='git flow hotfix start'
alias gflrs='git flow release start'
alias gflff='git flow feature finish'
alias gflfp='git flow feature publish'
alias gflhf='git flow hotfix finish'
alias gflrf='git flow release finish'
alias gflfp='git flow feature publish'
......
# git-hubflow plugin
This plugin adds completion for [HubFlow](https://datasift.github.io/gitflow/) (GitFlow for GitHub), as well as some
aliases for common commands. HubFlow is a git extension to make it easy to use GitFlow with GitHub. Based on the
original gitflow extension for git.
The hubflow tool has to be [installed](https://github.com/datasift/gitflow#installation) separately.
To use it, add `git-hubflow` to the plugins array in your zshrc file:
```zsh
plugins=(... git-hubflow)
```
## Aliases
| Alias | Command | Description |
|-------|------------------|------------------------------------------------------------------|
| ghf | `git hf` | Print command overview |
| ghff | `git hf feature` | Manage your feature branches |
| ghfr | `git hf release` | Manage your release branches |
| ghfh | `git hf hotfix` | Manage your hotfix branches |
| ghfs | `git hf support` | Manage your support branches |
| ghfu | `git hf update` | Pull upstream changes down into your master and develop branches |
#!zsh
#
# Installation
# ------------
#
# To achieve git-hubflow completion nirvana:
#
# 0. Update your zsh's git-completion module to the newest version.
# 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-hubflow-completion.zsh) and put the following line in
# your .zshrc:
#
# source ~/.git-hubflow-completion.zsh
#
# c. Or, use this file as an oh-my-zsh plugin.
#
alias ghf='git hf'
alias ghff='git hf feature'
alias ghfr='git hf release'
......@@ -97,8 +75,8 @@ __git-hf-release ()
'finish:Finish a release branch.'
'list:List all your release branches. (Alias to `git hf release`)'
'cancel:Cancel release'
'push:Push release to github'
'pull:Pull release from github'
'push:Push release to GitHub'
'pull:Pull release from GitHub'
'track:Track release'
)
_describe -t commands 'git hf release' subcommands
......@@ -155,8 +133,8 @@ __git-hf-hotfix ()
'list:List all your hotfix branches. (Alias to `git hf hotfix`)'
'publish:Publish the hotfix branch.'
'track:Track the hotfix branch.'
'pull:Pull the hotfix from github.'
'push:Push the hotfix to github.'
'pull:Pull the hotfix from GitHub.'
'push:Push the hotfix to GitHub.'
'cancel:Cancel the hotfix.'
)
_describe -t commands 'git hf hotfix' subcommands
......@@ -217,8 +195,8 @@ __git-hf-feature ()
'diff:Diff'
'rebase:Rebase feature branch against develop'
'checkout:Checkout feature'
'pull:Pull feature branch from github'
'push:Push feature branch to github'
'pull:Pull feature branch from GitHub'
'push:Push feature branch to GitHub'
'cancel:Cancel feature'
)
_describe -t commands 'git hf feature' subcommands
......
# git-prompt plugin
A `zsh` prompt that displays information about the current git repository. In particular:
the branch name, difference with remote branch, number of files staged or changed, etc.
To use it, add `git-prompt` to the plugins array in your zshrc file:
```zsh
plugins=(... git-prompt)
```
See the [original repository](https://github.com/olivierverdier/zsh-git-prompt).
## Examples
The prompt may look like the following:
- `(master↑3|✚1)`: on branch `master`, ahead of remote by 3 commits, 1 file changed but not staged
- `(status|●2)`: on branch `status`, 2 files staged
- `(master|✚7…)`: on branch `master`, 7 files changed, some files untracked
- `(master|✖2✚3)`: on branch `master`, 2 conflicts, 3 files changed
- `(experimental↓2↑3|✔)`: on branch `experimental`; your branch has diverged by 3 commits, remote by 2 commits; the repository is otherwise clean
- `(:70c2952|✔)`: not on any branch; parent commit has hash `70c2952`; the repository is otherwise clean
## Prompt Structure
By default, the general appearance of the prompt is:
```
(<branch><branch tracking>|<local status>)
```
The symbols are as follows:
### Local Status Symbols
| Symbol | Meaning |
|--------|--------------------------------|
| ✔ | repository clean |
| ●n | there are `n` staged files |
| ✖n | there are `n` unmerged files |
| ✚n | there are `n` unstaged files |
| … | there are some untracked files |
### Branch Tracking Symbols
| Symbol | Meaning |
|--------|---------------------------------------------------------------|
| ↑n | ahead of remote by `n` commits |
| ↓n | behind remote by `n` commits |
| ↓m↑n | branches diverged: other by `m` commits, yours by `n` commits |
## Customisation
- Set the variable `ZSH_THEME_GIT_PROMPT_CACHE` to any value in order to enable caching.
- You may also change a number of variables (whose name start with `ZSH_THEME_GIT_PROMPT_`)
to change the appearance of the prompt. Take a look at the bottom of the [plugin file](git-prompt.plugin.zsh)`
to see what variables are available.
**Enjoy!**
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment