Move into an external dir
[zsh.git] / .zsh / external / zaw / sources / git-reflog.zsh
1 function zaw-src-git-reflog () {
2 git rev-parse --git-dir >/dev/null 2>&1
3 if [[ $? == 0 ]]; then
4 git reflog | \
5 while read id desc; do
6 candidates+=("${id}")
7 cand_descriptions+=("${id} ${desc}")
8 done
9 fi
10 actions=(zaw-callback-append-to-buffer zaw-src-git-commit-checkout zaw-src-git-commit-reset zaw-src-git-commit-rebase zaw-src-git-commit-rebase-interactive zaw-src-git-commit-reset-hard)
11 act_descriptions=("append to edit buffer" "checkout" "reset" "rebase" "rebase interactive from..." "reset hard")
12 options=()
13 }
14
15 function zaw-src-git-commit-checkout () {
16 BUFFER="git checkout $1"
17 zle accept-line
18 }
19
20 function zaw-src-git-commit-reset () {
21 BUFFER="git reset $1"
22 zle accept-line
23 }
24
25 function zaw-src-git-commit-reset-hard () {
26 BUFFER="git reset --hard $1"
27 zle accept-line
28 }
29
30 function zaw-src-git-commit-rebase () {
31 BUFFER="git rebase $1"
32 zle accept-line
33 }
34
35 function zaw-src-git-commit-rebase-interactive () {
36 BUFFER="git rebase -i $1"
37 zle accept-line
38 }
39
40 zaw-register-src -n git-reflog zaw-src-git-reflog