mirror of
https://github.com/dcarrillo/prezto.git
synced 2025-07-01 03:29:26 +00:00
Add comments into each of the function files to make them easier to find
This commit is contained in:
@ -5,6 +5,8 @@
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
# function git-branch-current {
|
||||
|
||||
if ! git rev-parse 2> /dev/null; then
|
||||
print "$0: not a repository: $PWD" >&2
|
||||
return 1
|
||||
@ -18,3 +20,5 @@ if [[ -n "$ref" ]]; then
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
|
||||
# }
|
||||
|
@ -5,6 +5,8 @@
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
# function git-commit-lost {
|
||||
|
||||
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
||||
print "$0: not a repository work tree: $PWD" >&2
|
||||
return 1
|
||||
@ -18,3 +20,5 @@ git fsck 2> /dev/null \
|
||||
--no-walk \
|
||||
--stdin \
|
||||
--pretty=format:${_git_log_oneline_format}
|
||||
|
||||
# }
|
||||
|
@ -5,6 +5,8 @@
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
# function git-dir {
|
||||
|
||||
local git_dir="${$(git rev-parse --git-dir):A}"
|
||||
|
||||
if [[ -n "$git_dir" ]]; then
|
||||
@ -14,3 +16,5 @@ else
|
||||
print "$0: not a repository: $PWD" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
# }
|
||||
|
@ -5,6 +5,8 @@
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
# function git-hub-browse {
|
||||
|
||||
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
||||
print "$0: not a repository work tree: $PWD" >&2
|
||||
return 1
|
||||
@ -56,3 +58,5 @@ else
|
||||
print "$0: not a Git repository or remote not set" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
# }
|
||||
|
@ -5,6 +5,8 @@
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
# function git-hub-shorten-url {
|
||||
|
||||
local url="$1"
|
||||
|
||||
if [[ "$url" == '-' ]]; then
|
||||
@ -20,3 +22,5 @@ if (( $+commands[curl] )); then
|
||||
else
|
||||
print "$0: command not found: curl" >&2
|
||||
fi
|
||||
|
||||
# }
|
||||
|
@ -5,6 +5,8 @@
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
# function git-root {
|
||||
|
||||
local root="$(git rev-parse --show-toplevel 2> /dev/null)"
|
||||
|
||||
if [[ -n "$root" ]]; then
|
||||
@ -14,3 +16,5 @@ else
|
||||
print "$0: not a repository work tree: $PWD" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
# }
|
||||
|
@ -5,6 +5,8 @@
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
# function git-stash-clear-interactive {
|
||||
|
||||
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
||||
print "$0: not a repository work tree: $PWD" >&2
|
||||
return 1
|
||||
@ -20,3 +22,5 @@ if [[ -f "$(git-dir)/refs/stash" ]]; then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# }
|
||||
|
@ -5,6 +5,8 @@
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
# function git-stash-dropped {
|
||||
|
||||
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
||||
print "$0: not a repository work tree: $PWD" >&2
|
||||
return 1
|
||||
@ -20,3 +22,5 @@ git fsck --unreachable 2> /dev/null \
|
||||
--merges \
|
||||
--no-walk \
|
||||
--stdin
|
||||
|
||||
# }
|
||||
|
@ -5,6 +5,8 @@
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
# function git-stash-recover {
|
||||
|
||||
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
||||
print "$0: not a repository work tree: $PWD" >&2
|
||||
return 1
|
||||
@ -16,3 +18,5 @@ for commit in "$@"; do
|
||||
git update-ref \
|
||||
-m "$(git log -1 --pretty="format:%s" "$commit")" refs/stash "$commit"
|
||||
done
|
||||
|
||||
# }
|
||||
|
@ -5,6 +5,8 @@
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
# function git-submodule-move {
|
||||
|
||||
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
||||
print "$0: not a repository work tree: $PWD" >&2
|
||||
return 1
|
||||
@ -30,3 +32,5 @@ git-submodule-remove "$src"
|
||||
git submodule add "$url" "$dst"
|
||||
|
||||
return 0
|
||||
|
||||
# }
|
||||
|
@ -5,6 +5,8 @@
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
# function git-submodule-remove {
|
||||
|
||||
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
||||
print "$0: not a repository work tree: $PWD" >&2
|
||||
return 1
|
||||
@ -25,3 +27,5 @@ rm -rf "${1}"
|
||||
rm -rf "$(git-dir)/modules/${1}"
|
||||
|
||||
return 0
|
||||
|
||||
# }
|
||||
|
Reference in New Issue
Block a user