summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2021-08-23 07:55:17 -0400
committerMalfurious <m@lfurio.us>2021-08-23 07:55:17 -0400
commit349f82cd66818800c775595ede310e3bbc233468 (patch)
tree268635c137f45f81a3af88f16e352224a6305d43
parent0175c1c40f9567a401a986d85ab6d6f5365eec7a (diff)
downloadgit-sonar-349f82cd66818800c775595ede310e3bbc233468.tar.gz
git-sonar-349f82cd66818800c775595ede310e3bbc233468.zip
Remove dead code
Some code in the main script was only serving use in the (now deleted) tests. Remove anything from the main file with no references to it. Signed-off-by: Malfurious <m@lfurio.us>
-rwxr-xr-xgit-sonar119
1 files changed, 0 insertions, 119 deletions
diff --git a/git-sonar b/git-sonar
index 512b3c7..3fd4a09 100755
--- a/git-sonar
+++ b/git-sonar
@@ -7,23 +7,11 @@
################################################################################
# Original sonar-base
################################################################################
-
-NO_REMOTE_STATUS='--no-remote-status'
-
dot_git=""
-stat_type=""
cwd=""
remote=""
rcfile_path="$HOME"
-timethis() {
- cmd=("$@")
- start=$(gdate +%s.%N)
- eval "${cmd[@]}"
- dur=$(echo "$(gdate +%s.%N) - $start" | bc)
- echo "$1 - $dur" >> "$HOME/duration.dat"
-}
-
get_fetch_time() {
if [ -f "$rcfile_path/.gitradarrc.bash" ]; then
source "$rcfile_path/.gitradarrc.bash"
@@ -86,18 +74,6 @@ in_current_dir() {
fi
}
-echodebug() {
- echo "$@" 1>&2
-}
-
-debug_print() {
- local debug=$1
- local message=$2
- if [[ $debug == "debug" ]]; then
- echo "$message"
- fi
-}
-
dot_git() {
if in_current_dir && [[ -n "$dot_git" ]]; then
# cache dot_git to save calls to rev-parse
@@ -111,15 +87,6 @@ dot_git() {
fi
}
-stat_type() {
- if [[ "$OSTYPE" == "darwin"* ]]; then
- stat_type="gstat"
- else
- stat_type="stat"
- fi
- printf '%s' $stat_type
-}
-
is_repo() {
if [[ -n "$(dot_git)" ]]; then
return 0
@@ -128,14 +95,6 @@ is_repo() {
fi
}
-git_root() {
- if [ -d .git ]; then
- printf '%s' "$(pwd)"
- else
- printf '%s' "$(git rev-parse --show-toplevel 2>/dev/null)"
- fi
-}
-
record_timestamp() {
if is_repo; then
touch "$(dot_git)/lastupdatetime"
@@ -199,12 +158,6 @@ branch_name() {
fi
}
-branch_ref() {
- if is_repo; then
- printf '%s' "$(branch_name || commit_short_sha)"
- fi
-}
-
remote_branch_name() {
local localRef
local remote
@@ -277,39 +230,6 @@ remote_ahead_of_master() {
#them="\xE2\x83\x96%{$reset_color%}"
#both="\xE2\x83\xA1%{$reset_color%}"
-is_dirty() {
- if ! git rev-parse &> /dev/null; then
- #not in repo, thus not dirty
- return 1
- else
- #in repo, might be dirty
- if [[ -n "$(git ls-files --exclude-standard --others 2>/dev/null)" ]]; then
- #untracked files thus dirty
- return 0
- else
- #no untracked files
- if git show HEAD -- &> /dev/null; then
- #has a commit hash, thus not on an initial commit
- if ! git diff --quiet --ignore-submodules HEAD -- &> /dev/null; then
- #has differences thus dirty
- return 0
- else
- return 1
- fi
- else
- #no commit hash, thus can't use HEAD.
- #As it's inital commit we can just list the files.
- if [[ -n "$(ls -a -1 "$(git_root)" | grep -Ev '(\.|\.\.|\.git)')" ]]; then
- #files listed and no commit hash, thus changes
- return 0
- else
- return 1
- fi
- fi
- fi
- fi
-}
-
porcelain_status() {
printf '%s' "$(git status --porcelain 2>/dev/null)"
}
@@ -456,14 +376,6 @@ color_changes_status() {
printf $PRINT_F_OPTION "${changes:1}"
}
-bash_color_changes_status() {
- color_changes_status
-}
-
-zsh_color_changes_status() {
- color_changes_status
-}
-
color_local_commits() {
local green_ahead_arrow="${COLOR_LOCAL_AHEAD}↑$RESET_COLOR_LOCAL"
local red_behind_arrow="${COLOR_LOCAL_BEHIND}↓$RESET_COLOR_LOCAL"
@@ -485,14 +397,6 @@ color_local_commits() {
printf $PRINT_F_OPTION "$local_commits"
}
-bash_color_local_commits() {
- color_local_commits
-}
-
-zsh_color_local_commits() {
- color_local_commits
-}
-
color_remote_commits() {
local green_ahead_arrow="${COLOR_REMOTE_AHEAD}←$RESET_COLOR_REMOTE"
local red_behind_arrow="${COLOR_REMOTE_BEHIND}→$RESET_COLOR_REMOTE"
@@ -517,35 +421,12 @@ color_remote_commits() {
printf $PRINT_F_OPTION "$remote"
}
-bash_color_remote_commits() {
- color_remote_commits
-}
-
-zsh_color_remote_commits() {
- color_remote_commits
-}
-
readable_branch_name() {
if is_repo; then
printf $PRINT_F_OPTION "$COLOR_BRANCH$(branch_name || printf '%s' "detached@$(commit_short_sha)")$RESET_COLOR_BRANCH"
fi
}
-zsh_readable_branch_name() {
- readable_branch_name
-}
-
-bash_readable_branch_name() {
- readable_branch_name
-}
-
-show_remote_status() {
- if [[ "$*" == "*$NO_REMOTE_STATUS*" ]]; then
- return 1 # don't show the git remote status
- fi
- return 0
-}
-
stashed_status() {
printf '%s' "$(git stash list | wc -l 2>/dev/null | grep -oEi '[0-9][0-9]*')"
}