Updated commands and more labels
This commit is contained in:
@@ -19,7 +19,7 @@ export GIT_REPO_DIR="$HOME/src"
|
|||||||
export GIT_REPOS=""
|
export GIT_REPOS=""
|
||||||
export git_status_command="git_status_shortcuts"
|
export git_status_command="git_status_shortcuts"
|
||||||
# Alias
|
# Alias
|
||||||
git_repo_alias="s"
|
git_repo_alias="s" # The 's' could stand for 'switch' or 'sourcecode'..
|
||||||
|
|
||||||
|
|
||||||
# Git Aliases
|
# Git Aliases
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ alias $git_commit_amend_alias='git commit --amend'
|
|||||||
# Add staged changes to latest commit without prompting for message
|
# Add staged changes to latest commit without prompting for message
|
||||||
alias $git_commit_amend_no_msg_alias='git commit --amend -C HEAD'
|
alias $git_commit_amend_no_msg_alias='git commit --amend -C HEAD'
|
||||||
|
|
||||||
# Git repo management alias
|
# Git Index alias
|
||||||
alias $git_index_alias="git_index"
|
alias $git_index_alias="git_index"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
# -------------------------------------------------------
|
# -------------------------------------------------------
|
||||||
|
|
||||||
# -------------------------------------------------------
|
# -------------------------------------------------------
|
||||||
# Repository Indexing scripts for Git projects
|
# Repository Index scripts for Git projects
|
||||||
# -------------------------------------------------------
|
# -------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
# (Scanning for git projects and submodules can take a few seconds.)
|
# (Scanning for git projects and submodules can take a few seconds.)
|
||||||
#
|
#
|
||||||
# * Cache can be rebuilt by running:
|
# * Cache can be rebuilt by running:
|
||||||
# $ git_index --rebuild-index
|
# $ git_index --rebuild
|
||||||
# ('--' commands have tab completion too.)
|
# ('--' commands have tab completion too.)
|
||||||
#
|
#
|
||||||
# * Ignores projects within an 'archive' folder.
|
# * Ignores projects within an 'archive' folder.
|
||||||
@@ -53,7 +53,7 @@ function git_index() {
|
|||||||
# Just change to $GIT_REPO_DIR if no params given.
|
# Just change to $GIT_REPO_DIR if no params given.
|
||||||
cd $GIT_REPO_DIR
|
cd $GIT_REPO_DIR
|
||||||
else
|
else
|
||||||
if [ "$1" = "--rebuild-index" ]; then
|
if [ "$1" = "--rebuild" ]; then
|
||||||
_rebuild_git_index
|
_rebuild_git_index
|
||||||
elif [ "$1" = "--update-all" ]; then
|
elif [ "$1" = "--update-all" ]; then
|
||||||
_git_index_git_update_all
|
_git_index_git_update_all
|
||||||
@@ -221,7 +221,7 @@ function _git_index_tab_completion() {
|
|||||||
COMPREPLY=($(compgen -d "$base_path$search_path" | grep -v "/.git" | sed -e "s:$base_path:$project:" -e "s:$:/:" ))
|
COMPREPLY=($(compgen -d "$base_path$search_path" | grep -v "/.git" | sed -e "s:$base_path:$project:" -e "s:$:/:" ))
|
||||||
# Else, tab complete all the entries in .git_index, plus '--' commands
|
# Else, tab complete all the entries in .git_index, plus '--' commands
|
||||||
else
|
else
|
||||||
local commands="--list\n--rebuild-index\n--update-all\n--batch-cmd\n--count-by-host"
|
local commands="--list\n--rebuild\n--update-all\n--batch-cmd\n--count-by-host"
|
||||||
COMPREPLY=($(compgen -W '$(sed -e "s:.*/::" -e "s:$:/:" "$GIT_REPO_DIR/.git_index" | sort)$(echo -e "\n"$commands)' -- $curw))
|
COMPREPLY=($(compgen -W '$(sed -e "s:.*/::" -e "s:$:/:" "$GIT_REPO_DIR/.git_index" | sort)$(echo -e "\n"$commands)' -- $curw))
|
||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ index_no_newlines() {
|
|||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
test_repo_index_command() {
|
test_repo_index_command() {
|
||||||
git_index --rebuild-index > /dev/null
|
git_index --rebuild > /dev/null
|
||||||
|
|
||||||
# Test that all repos are detected, and sorted alphabetically
|
# Test that all repos are detected, and sorted alphabetically
|
||||||
assertIncludes "$(index_no_newlines)" "bitbucket.*\
|
assertIncludes "$(index_no_newlines)" "bitbucket.*\
|
||||||
|
|||||||
Reference in New Issue
Block a user