scmbreeze / scm_breeze Goto Github PK
View Code? Open in Web Editor NEWAdds numbered shortcuts to the output git status, and much more
Home Page: https://madebynathan.com/2011/10/19/git-shortcuts-like-youve-never-seen-before/
License: MIT License
Adds numbered shortcuts to the output git status, and much more
Home Page: https://madebynathan.com/2011/10/19/git-shortcuts-like-youve-never-seen-before/
License: MIT License
I'm getting following errors after installing the current master at adedf86
~/.scm_breeze (master) $ source ~/.bashrc
-bash: alias: =exec_scmb_expand_args _scmb_git_branch_shortcuts -m: not found
-bash: alias: =exec_scmb_expand_args _scmb_git_branch_shortcuts -d: not found
-bash: alias: =exec_scmb_expand_args _scmb_git_branch_shortcuts -D: not found
using bash on osx
I'm using Ubuntu 12.10 and ran into this error when running ./install.sh
--- ~ » /.scm_breeze/install.sh/.bashrc'
== Added SCM Breeze to '
== Added SCM Breeze to '~/.zshrc'
/home/ptaylor/.scm_breeze/install.sh: 22: /home/ptaylor/.scm_breeze/install.sh: source: not found
/home/ptaylor/.scm_breeze/install.sh: 24: /home/ptaylor/.scm_breeze/install.sh: _create_or_patch_scmbrc: not found
== Run 'source ~/.bashrc' or 'source ~/.zshrc' to load SCM Breeze into your current shell.
So I decided to amuse myself:
--- ~ » which source
source: shell built-in command
Anyway, I just changed source to "." and that seemed to work. Here's the diff:
--- ~scmbDir ‹master* M⁇› » git diff
diff --git a/install.sh b/install.sh
index c2e2798..bfa99cb 100755
--- a/install.sh
+++ b/install.sh
@@ -19,7 +19,7 @@ for rc in bashrc zshrc; do
done
-source "$scmbDir/lib/scm_breeze.sh"
+. "$scmbDir/lib/scm_breeze.sh"
_create_or_patch_scmbrc
Thanks for an awesome script! I was using this fine with bash, but I just switched to oh-my-zsh. When I run the gd command, I get the following error:
➤ Changes to be committed
#
# modified: [1] Gemfile
#
➤ Changes not staged for commit
#
# modified: [2] Gemfile.lock
# modified: [3] app/models/user.rb
# modified: [4] config/initializers/devise.rb
$ gd 2
fatal: ambiguous argument 'cd': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
However, I can still do gd $e2
and ga 2
and those work fine. Any idea what might be going on?
I'm not seeing the branch in the gs display
Hi,
I have a script that uses the output of the original git branch
command. Upon installing scm_breeze, it appears that not only gb
, but the original git branch
also now has additional things bound to it.
Is there a way I can still run git's vanilla git branch
command?
# normal git
$ git branch
* master
# scm_breeze
$ git branch
* [1] master
Hi,
I'm trying to use colors in my diffs. I tried adding an alias in my git-config like this:
[alias]
diff = diff --color-words
But it didn't work. Any ideas? --color-words is awesome to use.
Thanks and keep up the good work!
I expect gbd to use a non-destructive '-d', which fails if the branch is not merged. Just like gcob using '-b' and not '-B'. Or make it configurable.
I am trying to try scm_breeze on MAC OS X - 10.7.2 with ITERM2
After I followed the installation steps I get the following error
sed: 1: "s/^* ([^ ]*)/\1/;tm; ...": undefined label 'm;d;:m'
Any thoughts on what is going on here?
In the latest version of scm_breeze (2ef3776), typing gs
followed by echo $e1
outputs the name of the first branch of the current git directory. For example:
~/dev/scm_breeze (master) $ git log -1
commit 2ef3776fe132a779ad657b976035d1d56677ed79
Author: Nathan Broadbent <[email protected]>
Date: Wed Nov 28 19:40:38 2012 +1300
git_branch_delete_all should take '-f' arg to use -D arg
~/dev/scm_breeze (master) $ gs
# On branch: master | No changes (working directory clean)
~/dev/scm_breeze (master) $ echo $e1
master
I have not used any previous version of scm_breeze but these appears to be a bug.
Under OS X 10.8 (Mountain Lion)...
Attempting to use the keyboard shortcuts in the following manner:
$ gs
...
$ 1 2 3 5 <CTRL-X>-C
$ git_add_and_commit1 2 3 5
zsh: correct 'git_add_and_commit1' to 'git_add_and_commit' [nyae]?
As you can see, it appears that scm_breeze is not putting a space after the function name and it's tripping-up ZSH.
Oh My Zsh Next has awesome Git aliases grouped by category. If one wished to use scm_breeze, he would have to duplicate said aliases in ~/.git.scmbrc. It would be better for scm_breeze to redefine aliases programatically by parsing the $aliases
array.
I just spent about 30 minutes trying to track down why my 'll' (LL) command wasn't working properly. It appears that the LL function added by scm_breeze is not working for BSD-style LS -- which OS X has.
https://github.com/ndbroadbent/scm_breeze/blob/master/lib/git/shell_shortcuts.sh#L54
I'm not sure if this can be fixed but I'm going to disable this functionality. This is just a heads-up.
https://github.com/ndbroadbent/scm_breeze/blob/master/lib/git/status_shortcuts.sh#L85
The '-c' flag is illegal on OSX.
Looking for a more crossplatform solution.
~/.scm_breeze/lib/git/status_shortcuts.rb:199: undefined method `start_with?' for...
Using zsh 4.3.17 in ITerm2 on a mac
Ctrl-x c produces
❯ "dd_and_commit
"dd_and_commit
dquote> "
Ctrl-x SPC produces
❯ " git_commit_all
" git_commit_all
dquote> "
Hi - Just installed current HEAD and now my 'ls' command just hangs... I'm on Lion, using scm_breeze with oh-my-zsh in Terminal.app. Not sure what other information to give as there are no errors, just hanging.
Example Error output
$ gap 1
bash: syntax error: unexpected end of file
#
# On branch: some-branch | [*] => $e*
#
➤ Changes not staged for commit
#
# modified: [1] README
#
After running a git bisect
I have identified 5e507af as the first commit that causes this error.
My environment
$ bash --version
GNU bash, version 4.2.20(2)-release (x86_64-unknown-linux-gnu)
$ git --version
git version 1.7.9
Hello,
When using scm_breeze's index functionality I'm getting the below error and this is due to undefined function being used in repo_index.sh
s watch_tower/ wael@Phoenix-X
_git_index_pull_or_status:11: command not found: parse_git_branch
Thank you, this project is really helpful and can speed up workflow
Regards,
Wael Nasreddine
Using zsh and the latest scm_breeze revision, following errors occur:
➜ ~ source .scm_breeze/scm_breeze.sh
.scm_breeze/lib/git/aliases.sh:78: exec_scmb_expand_args not found
.scm_breeze/lib/git/branch_shortcuts.sh:43: exec_scmb_expand_args _scmb_git_branch_shortcuts -m not found
I just did an update and I'm getting the following error when I open a terminal:
bash: eval: line 44: syntax error near unexpected token `('
bash: eval: line 44: `cd(){'
$ bash --version
GNU bash, version 4.2.37(2)-release (i686-pc-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ uname -a
Linux dell-17 3.5.4-1-ARCH #1 SMP PREEMPT Sat Sep 15 13:04:04 UTC 2012 i686 GNU/Linux
haven't got time to troubleshoot this, and after this it seems to still work just fine... But was wondering if someone knows what might be going on.
Setting IFS as a local seems broken in zsh ($e1
includes the entire |-separated string of file names and $e2
through $eN
are empty) and should in any case be unnecessary. There are a couple of obvious solutions.
oldIFS="$IFS"
# do stuff
IFS="$oldIFS"
IFS="|" for file in $files; do
# do stuff
done
filesArray=("${(s/|/)files}")
for file in $filesArray; do
# do stuff
done
Hi,
I did a upgrade and now I'm getting the following when I run sudo somthing
sudo: exec_scmb_expand_args: command not found
Square brackets, for instance:
$ mkdir "a [b]"
$ ll "a [b]"
(eval):1: no matches found: [b]
(Using zsh on osx, btw)
I'm getting the following after I upgraded to the lastest version
/home/colin/.scm_breeze/lib/git/branch_shortcuts.sh:46: exec_scmb_expand_args _scmb_git_branch_shortcuts -D not found
This is more of a support question than a bug report.. but when I load scm_breeze my bash prompt takes over a second to render where before there was no delay. This the the only code I have to setup my prompt:
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWUPSTREAM="auto"
function git_ps1() {
builtin hash __git_ps1 2>&- \
&& __git_ps1 " on \[\e[0;36m\]%s \[\e[0;32m\]∓\[\e[0m\]"
}
PS1='\[\e[01;32m\]\u@\h\[\e[00m\]:\[\e[01;36m\]\w\[\e[00;33m\]$(__git_ps1 " (%s)")\[\e[00;00m\]$ '
My guess is that a lot of time is being taking up in the git
function wrapper that scm_breeze
defines but I don't really know for sure. It seems like other people would have run into this same issue before.. is there a workaround for this? Do you use __git_ps1
in your setup?
BTW, I'm on OSx 10.8.1 (Mountain Lion), bash version 4.1.7(2), and git 1.7.11.4.
I have my arrow keys set to search through history with:
--arrow up
"\e[A":history-search-backward
--arrown down
"\e[B":history-search-forward
Disabling scm_breeze in my bashrc fixes it, and I cant figure out where its being changed at. How can I fix this?
I updated scm_breeze and now I'm getting the following errors upon opening a new terminal window:
/Users/interhive/.scm_breeze/lib/git/aliases.sh:78: exec_scmb_expand_args not found
/Users/interhive/.scm_breeze/lib/git/branch_shortcuts.sh:43: exec_scmb_expand_args _scmb_git_branch_shortcuts -m not found
Any clue what I've seemed to have messed up in the update?
Thanks!
In lib/git/aliases_and_bindings.sh, on line 113, the function bashcompinit is autoloaded by:
autoload bashcompinit
This presents a slight problem if the user defines some aliases, that are expanded in bashcompinit and cause errors.
To avoid that, you can use the -U option, which suppresses alias expansion:
autoload -U bashcompinit
I upgraded from 1.7.11.5 ==> 1.7.12 and I get this output when I try to tab autocomplete.
bash: completion: function `_git' not found
Upstream may have changed something? Or the Arch package is missing something? I've downgraded back to 1.7.11.5 so this isn't a critical problem for me and we can take out time solving this one.
ga
does not work on zsh for me. It seems that it has something to do with the number of change files, I saw this behavior:
ga 1
worked finega 1
produces an error (see below)ga 2
does nothing (see below)tri:...git/blau_de[trunk]> gs
# On branch: trunk | [*] => $e*
#
➤ Changes not staged for commit
#
# modified: [1] README.md
# modified: [2] Rakefile
#
tri:...git/blau_de[trunk]> ga 1
# fatal: Could not switch to '/Users/tri/Documents/git/blau_de/README.md|/Users/tri/Documents/git/blau_de': No such file or directory
#
# On branch: trunk | [*] => $e*
#
➤ Changes not staged for commit
#
# modified: [1] README.md
# modified: [2] Rakefile
#
tri:...git/blau_de[trunk]> ga 2
#
# On branch: trunk | [*] => $e*
#
➤ Changes not staged for commit
#
# modified: [1] README.md
# modified: [2] Rakefile
#
tri:...git/blau_de[trunk]>
After having installed scm_breeze on my new Ubuntu 12.10 (I use on my other computers on 10.10, 11.04 and 12.04), I have this :
linux prompt > builtin type cd
cd est un alias vers « exec_scmb_expand_args »
I had to uninstall it to get my cd back.
I get this when I attempt to use for completion.
$ gba
* master
remotes/ndbroadbent/master
remotes/origin/HEAD -> origin/master
remotes/origin/master
$ gf nd
If I stroke a to complete nd => ndbroadbent I get this output and it moves my cursor to the next line.
$ gf nd-bash: [: 2: unary operator expected
If I then press again
$ gf nd-bash: [: 2: unary operator expected
-bash: [: 2: unary operator expected
ndbroadbent origin
$ gf nd
$ uname -a
Darwin ****** 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug 9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64 i386
$ bash --version
GNU bash, version 4.2.10(2)-release (i386-apple-darwin11.2.0)
I don't notice this problem on ubuntu 10.04
$ uname -a
Linux ****** 2.6.35.4-****** #8 SMP Mon Sep 20 15:54:33 UTC 2010 x86_64 GNU/Linux
$ bash --version
GNU bash, version 4.1.5(1)-release (x86_64-pc-linux-gnu)
This is what I see (all in white, normal color)
\e[0;33mCommitting all files (\e[0;31m 1\e[0;33m)\e[0m
Commit Message:
On Mac OS X 10.8.2, using bash 4.2.42(2)-release, line 239 of lib/git/repo_index.sh
appears to not work, specifically, this bit of code:
$(git rev-parse ${remotes[$index]}/${merges[$index]})
The two array references, $remotes[$index]
and $merges[$index]
both return as an empty value, which means it tries to run this command:
$ git rev-parse /
which responds with:
$ fatal: Not a valid object name /
Having a little problem on OS X 10.7.3:
$ ga 1
The spaces between Adobe Flash Builder 4.6 have gone away.
By default modified, unstaged files are red in the output of git status, and they turn green only after you've staged them.
scm_breeze breaks this default behavior and the output is always green, maybe by design? Not sure.
Thank you for great tool. I always use scm_breeze shortcut set.
'gitflow' propose standard branching model with 'master, develop, feature, hotfix' and support good tool for that process.
example
git flow feature start feature_name
... working and commit in feature/feature_name ...
git flow feature finish feature_name
You could see on https://github.com/nvie/gitflow
Until now, I have been used scm_breeze and gitflow with no problem. But after recent upgrade scm_breeze, my gitflow operation is broken.
for example.
'git flow feature start' function work well. But 'git flow feature finish' don't work.
$ git f feature start SCV-18_block_swipe_action_with_view_pager
... work...
$ gs
# On branch: feature/SCV-18_block_swipe_action_with_view_pager | No changes (working directory clean)
$ gb
[1] develop
* [2] feature/SCV-18_block_swipe_action_with_view_pager
[3] master
$ git f feature finish feature/SCV-18_block_swipe_action_with_view_pager
No branch matches prefix 'feature/SCV-18_block_swipe_action_with_view_pager'
Could you check your scm_breeze functionality?
or Could you support 'temporary turn off' in scm_breeze ?
When I installed scm_breeze, my XSession stopped logging in properly (Ubuntu 10.04LTS/Bash 4.1.5). My .xsession-errors
file reads below:
/etc/gdm/Xsession: Beginning session setup...
/home/jolivier/.scm_breeze/lib/git/aliases_and_bindings.sh: line 44: `_git_grs-_shortcut': not a valid identifier
By removing the scm_breeze call from my .bashrc
, I can login normally again.
Curiously, if I re-enable scm_breeze after login, everything works fine. Indeed, the error doesn't even pop up when I open terminals or source ~/.scm_breeze/scm_breeze.sh
.
In the screenshot of the new shell-wrapped commands it shows the directories/files been color coded like a normal ls -l
will do if colors are turned on. On my Mac (10.8) the wrapped ll
command does not produce colors. I'm using bash shell.
Is there something I need to do to enable colorization?
/Users/ptaylor/.scm_breeze/lib/git/aliases.sh:78: exec_scmb_expand_args not found
/Users/ptaylor/.scm_breeze/lib/git/branch_shortcuts.sh:44: exec_scmb_expand_args _scmb_git_branch_shortcuts -m not found
This is after running ./install and opening a new Tab.
Hello,
After installing scm breeze, I don't have any completions for git
commands.
For example, previously, if I typed git checkout
and pressed TAB
, zsh would show me a list of branches to checkout to, this no longer happens when using scm breeze.
How can I check what is wrong?
I am using oh-my-zsh and Mac OS X.
Thanks
--- /usr/local ‹master› » which mv
mv: aliased to exec_scmb_expand_args nocorrect mv
billy-woopra 福 ~
3804 ± : which mv
mv: aliased to exec_scmb_expand_args nocorrect mv
billy-woopra 福 ~
3805 ± : mv
billy-woopra 福 ~
3806 ± : /bin/mv
usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory
How do I undo this?
Fresh install of scm breeze, install works and
source ~/.zshrc
works as well, but all subsequent
source ~/.zshrc
cause
/Users/bendavies/.scm_breeze/lib/scm_breeze.sh:export:15: not valid in this context: ()
First of all many thanks for scm_breeze! Really helps in my everyday work with git.
I have used it for a while and had no problems but today, suddenly, it stopped working properly. When I type:
gs
I don't see colored and numbered list but standard "git status" like:
# On branch working
# Your branch is ahead of 'origin/working' by 3594 commits.
#
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: abc
# modified: def
# modified: ghi
I tried reinstalling scm_breeze by:
~/.scm_breeze/install.sh
and I got:
== Added SCM Breeze to '~/.bashrc'
== Run 'source ~/.bashrc' or 'source ~/.zshrc' to load SCM Breeze into your current shell.
So I runned:
source ~/.bashrc
but problem is not solved.
Any help?
Heya - at least in my zsh (4.3.9 (i386-apple-darwin10.0) on Snow Leopard), it seems that you need to run "setopt SH_WORD_SPLIT" before zsh will consider the IFS setting.
Without this, I'd run 'gs; gd 1', and was just getting :
fatal: failed to stat '/Users/jon/Developer/web/app/gui/gui/views/audioboo/follow_button_section.rb|/Users/jon/Developer/web/config/environments/development.rb|/Users/jon/Developer/web/deploy/lib/sphinx.rb|[..............................]': File name too long
Rather than messing with setopt environment, an alternative option would be to use ${=foo} - eg in git_status_shortcuts :
for file in ${=files}; do export $git_env_char$e="$file"; let e++; done
but I'm guessing that won't work in bash.
Any thoughts?
After installing scm_breeze on a zsh shell on OSX 10.7.4, I get this error every time I reload my .zshrc file:
/Users/seth/.scm_breeze/lib/git/aliases_and_bindings.sh:117: command not found: compdef
/Users/seth/.scm_breeze/lib/git/aliases_and_bindings.sh:118: command not found: compdef
/Users/seth/.scm_breeze/lib/git/aliases_and_bindings.sh:119: command not found: compdef
/Users/seth/.scm_breeze/lib/git/aliases_and_bindings.sh:120: command not found: compdef
/Users/seth/.scm_breeze/lib/git/aliases_and_bindings.sh:121: command not found: compdef
/Users/seth/.scm_breeze/lib/git/aliases_and_bindings.sh:122: command not found: compdef
/Users/seth/.scm_breeze/lib/git/aliases_and_bindings.sh:123: command not found: compdef
/Users/seth/.scm_breeze/lib/git/aliases_and_bindings.sh:124: command not found: compdef
/Users/seth/.scm_breeze/lib/git/aliases_and_bindings.sh:125: command not found: compdef
/Users/seth/.scm_breeze/lib/git/aliases_and_bindings.sh:126: command not found: compdef
/Users/seth/.scm_breeze/lib/git/aliases_and_bindings.sh:127: command not found: compdef
/Users/seth/.scm_breeze/lib/git/aliases_and_bindings.sh:128: command not found: compdef
/Users/seth/.scm_breeze/lib/git/aliases_and_bindings.sh:129: command not found: compdef
/Users/seth/.scm_breeze/lib/git/aliases_and_bindings.sh:130: command not found: compdef
/Users/seth/.scm_breeze/lib/git/aliases_and_bindings.sh:131: command not found: compdef
/Users/seth/.scm_breeze/lib/git/aliases_and_bindings.sh:132: command not found: compdef
complete:13: command not found: compdef
complete:13: command not found: compdef
Most functionality appears to work correctly, but I'm also experiencing this issue.
c
works, in that it indexes and jumps to projects correctly, but it does not autocomplete.
Any ideas?
I've just finished some work that integrates the numeric shortcuts into the rest of your shell commands.
So, as well as shortcuts for files in git status
, you can now also get shortcuts to files from the output of ls
. I was using ll
as an alias for ls -l
, but now I've turned ll
into an SCM Breeze function that gives the following output:
After typing ll
, you can use any of the following commands with the numbered shortcuts:
vim
, emacs
, gedit
, cat
, rm
, cp
, mv
, ln
, ls
, cd
For example, let's say you wanted display the contents of scmbrc.example
- now you can just type cat 11
.
I've tested it out as much as I can, but I'm sure we will run into some strange issues at some point.
If you would like to help test it, please update scm_breeze from the master
branch and let me know how it works for you.
Also let me know if you have any suggestions for commands that should be added to the list above.
Thanks!
Running latest master on OSX 10.7.5 in Terminal.app with oh-my-zsh
mv: aliased to exec_scmb_expand_args nocorrect mv
When trying to move a file it just hangs for a moment, and the file is not moved.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.