From 3a507fbd5a74708e27edda820c1e005e6defaaaa Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Mon, 13 Aug 2012 01:21:23 +1200 Subject: [PATCH] #34 - Increased max changes before falling back to standard git status, from 99 to 150. Also added a explanation message that is shown after the regular git status. --- git.scmbrc.example | 4 ++-- lib/git/status_shortcuts.sh | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/git.scmbrc.example b/git.scmbrc.example index b73d932..c452594 100644 --- a/git.scmbrc.example +++ b/git.scmbrc.example @@ -4,8 +4,8 @@ # - Set your preferred prefix for env variable file shortcuts. # (I chose 'e' because it is easy to slide your finger to it from '$'.) export git_env_char="e" -# - Max changes before reverting to 'git status'. git_status_shortcuts() may slow down for lots of changes. -export gs_max_changes="99" +# - Max changed files before reverting to 'git status'. git_status_shortcuts() will be slower for lots of changed files. +export gs_max_changes="150" # - When using the git_add_shorcuts() command, automatically invoke 'git rm' to remove deleted files? export ga_auto_remove="yes" diff --git a/lib/git/status_shortcuts.sh b/lib/git/status_shortcuts.sh index f2fbef2..238c186 100644 --- a/lib/git/status_shortcuts.sh +++ b/lib/git/status_shortcuts.sh @@ -27,7 +27,9 @@ git_status_shortcuts() { fi if [[ -z "$cmd_output" ]]; then # Just show regular git status if ruby script returns nothing. - git status; return 1 + git status + echo -e "\n\e[33mThere were more than $gs_max_changes changed files. SCM Breeze has fallen back to standard \`git status\` for performance reasons.\e[0m" + return 1 fi # Fetch list of files from last line of script output files="$(echo "$cmd_output" | \grep '@@filelist@@::' | sed 's%@@filelist@@::%%g')"