From 93dad96832a59d3d7f6ac6580cabf0202b387ffe Mon Sep 17 00:00:00 2001 From: Reinaldo Colina Date: Fri, 28 Aug 2015 13:55:37 -0700 Subject: Removing --minimal arg implementation - Dealing with the git: prefix will be done in a separate pull request - The new --no-remote-status arg remains --- README.md | 15 --------------- prompt.bash | 6 +----- radar-base.sh | 9 --------- test-radar-base.sh | 23 ----------------------- 4 files changed, 1 insertion(+), 52 deletions(-) diff --git a/README.md b/README.md index f126a21..b9268ee 100644 --- a/README.md +++ b/README.md @@ -137,21 +137,6 @@ export PS1="$PS1\$(git-radar --bash --fetch)" export PROMPT="$PROMPT$(git-radar --zsh --fetch) " ``` -### (Optional) Minimal mode - -If you wish to keep the length of your prompt shorter, you can call git-radar with `--minimal` which will render the new prompt without the `git:` part - -**Bash** -```bash -export PS1="$PS1\$(git-radar --bash --fetch --minimal) " -``` -(note: the `\` escaping the `$` is important) - -**Zsh** -```zsh -export PROMPT="$PROMPT$(git-radar --zsh --fetch --minimal) " -``` - ## License Git Radar is licensed under the MIT license. diff --git a/prompt.bash b/prompt.bash index 1e79cd9..429c88d 100755 --- a/prompt.bash +++ b/prompt.bash @@ -1,15 +1,11 @@ #! /usr/bin/env bash dot="$(cd "$(dirname "$0")"; pwd)" -git_label="" args=$@ source "$dot/radar-base.sh" if is_repo; then - if show_git_label $args; then - git_label="git:" - fi - printf " \x01\033[1;30m\x02$git_label(\x01\033[0m\x02" + printf " \x01\033[1;30m\x02git:(\x01\033[0m\x02" if show_remote_status $args; then bash_color_remote_commits fi diff --git a/radar-base.sh b/radar-base.sh index a2f5115..d019629 100755 --- a/radar-base.sh +++ b/radar-base.sh @@ -1,4 +1,3 @@ -IS_MINIMAL='--minimal' NO_REMOTE_STATUS='--no-remote-status' dot_git="" @@ -472,14 +471,6 @@ zsh_color_remote_commits() { printf %s "$remote" } - -show_git_label() { - if [[ $@ == *$IS_MINIMAL* ]]; then - return 1 # don't show the git label - fi - return 0 -} - show_remote_status() { if [[ $@ == *$NO_REMOTE_STATUS* ]]; then return 1 # don't show the git remote status diff --git a/test-radar-base.sh b/test-radar-base.sh index ca95136..9f7f8ee 100755 --- a/test-radar-base.sh +++ b/test-radar-base.sh @@ -2,29 +2,6 @@ scriptDir="$(cd "$(dirname "$0")"; pwd)" source "$scriptDir/radar-base.sh" -test_show_git_label() { - show_git_label - assertTrue $? - - show_git_label --bash - assertTrue $? - - show_git_label --bash --fetch - assertTrue $? - - show_git_label --bash --minimal --fetch - assertFalse $? - - show_git_label --bash --fetch --minimal - assertFalse $? - - show_git_label --minimal --bash --fetch - assertFalse $? - - show_git_label --bash --fetch --minimal --no-remote-status - assertFalse $? -} - test_show_remote_status() { show_remote_status assertTrue $? -- cgit v1.2.3