Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

convert zgit lib to zsh-style autoloads

  • Loading branch information...
commit 82b3653866499b948894d7aaa869c566998fb69f 1 parent 13a1078
@rsanders authored
View
2  zsh/lib/zgit/functions/zgit_branch
@@ -1,6 +1,5 @@
#!/bin/zsh
-function zgit_branch() {
emulate -L zsh
local branch git_dir
REPLY=""
@@ -15,4 +14,3 @@ function zgit_branch() {
fi
return 1
-}
View
1  zsh/lib/zgit/functions/zgit_dir
@@ -44,3 +44,4 @@ function zgit_dir() {
[[ -n $REPLY ]]
}
+zgit_dir $*
View
2  zsh/lib/zgit/functions/zgit_dirty
@@ -1,6 +1,5 @@
#!/bin/zsh
-function zgit_dirty () {
emulate -L zsh
local gitstatus
@@ -9,4 +8,3 @@ function zgit_dirty () {
[[ -n ${gitstatus:#*nothing to commit*} ]] && return 0
fi
return 1
-}
View
3  zsh/lib/zgit/functions/zgit_in_p
@@ -1,7 +1,6 @@
#!/bin/zsh
-function zgit_in_p() {
zgit_dir > /dev/null
[[ -n $REPLY ]]
-}
+
View
2  zsh/lib/zgit/functions/zgit_op
@@ -1,6 +1,5 @@
#!/bin/zsh
-function zgit_op () {
emulate -L zsh
local op="" git_dir="" branch=""
@@ -65,4 +64,3 @@ function zgit_op () {
REPLY=$op
[[ -z "$op" ]] && return 1
echo $op
-}
View
2  zsh/lib/zgit/functions/zgit_revision
@@ -1,6 +1,5 @@
#!/bin/zsh
-function zgit_revision() {
emulate -L zsh
setopt typeset_silent
local branch git_dir rev
@@ -16,4 +15,3 @@ function zgit_revision() {
REPLY=""
return 1
-}
View
2  zsh/lib/zgit/functions/zgit_status
@@ -14,7 +14,6 @@
# Returns 0 for clean, 1 for dirty
#
-function zgit_status {
emulate -L zsh
local gitstatus statstring res=0
local git_dir
@@ -63,4 +62,3 @@ function zgit_status {
REPLY=$statstring
echo -n -E $statstring
return $res
-}
View
4 zsh/lib/zgit/init.zsh
@@ -9,6 +9,8 @@
#
#
+echo "RUNNING ZGIT INIT.ZSH"
+
local libdir=${0:h}
typeset -g -A -H zgit_vars
@@ -26,7 +28,7 @@ function zgit_setup() {
local _zfile
for _zfile in $libdir/functions/*; do
- autoload -Uk ${_zfile:t}
+ autoload -U ${_zfile:t}
done
# setup in current dir
View
33 zsh/lib/zgit/librc.zsh
@@ -1,33 +0,0 @@
-#!/bin/zsh
-#
-# References / Inspirations
-#
-# zsh bundled vcs_info
-# original box prompt source from which the rsbox theme was hacked up
-# http://github.com/sudish/dotfiles/blob/master/.zshinit/S90_git_status
-# http://volnitsky.com/project/git-prompt/git-prompt.sh
-#
-#
-
-local libdir=${0:h}
-
-typeset -g -A -H zgit_vars
-typeset -g -A -H zgit_dirs
-
-function zgit_reset() {
- # nothing
-}
-
-function zgit_setup() {
- local dir="${1:h}"
- zgit_reset
-}
-
-local _zfile
-
-for _zfile in $libdir/functions/*; do
- autoload -Uk ${_zfile:t}
-done
-
-# setup in current dir
-zgit_setup ${0:h}
Please sign in to comment.
Something went wrong with that request. Please try again.