scmbreeze / scm_breeze

Adds numbered shortcuts to the output git status, and much more
https://madebynathan.com/2011/10/19/git-shortcuts-like-youve-never-seen-before/
MIT License
2.82k stars 192 forks source link

The scmb environment breaks when doing "gb -a" in a repo with too many branches – all subsequent commands fail with "Argument list too long" #201

Closed folkol closed 8 years ago

folkol commented 8 years ago

Environment:

OS: Mac OS X 10.10.5

Shell: $ bash --version _GNU bash, version 4.3.42(1)-release (x8664-apple-darwin14.5.0)

scmb: $ git show --oneline b6531e8 Merge pull request #193 from zackzachariah/master

Workaround:

As a workaround, I have commented out the scmb-enhancement to git branch:

$ git diff
diff --git a/lib/git/aliases.sh b/lib/git/aliases.sh
index 78368e8..32f5349 100644
--- a/lib/git/aliases.sh
+++ b/lib/git/aliases.sh
@@ -30,8 +30,8 @@ function git(){
       exec_scmb_expand_args "$_git_cmd" "$@";;
     checkout|diff|rm|reset)
       exec_scmb_expand_args --relative "$_git_cmd" "$@";;
-    branch)
-      _scmb_git_branch_shortcuts "${@:2}";;
+#    branch)
+#      _scmb_git_branch_shortcuts "${@:2}";;
     *)
       "$_git_cmd" "$@";;
   esac

To reproduce:

$ gs
# On branch: master  |  No changes (working directory clean)
$ gb -a
  [1]  some-branch-1
  ...
  [6844] some-branch-6844
$ gs
-bash: /usr/bin/env: Argument list too long
-bash: /usr/local/bin/git: Argument list too long

There were more than 150 changed files. SCM Breeze has fallen back to standard `git status` for performance reasons.
ndbroadbent commented 8 years ago

Jeez, that's a lot of branches! 987da4d sets the limit to 300, any more than that and we just show the regular git branch output without any env variables. Hopefully that's enough for most people