Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display error code bash alias with git_prompt_info #2226

Closed
coin-au-carre opened this issue Nov 6, 2013 · 1 comment · Fixed by #2827
Closed

Display error code bash alias with git_prompt_info #2226

coin-au-carre opened this issue Nov 6, 2013 · 1 comment · Fixed by #2827

Comments

@coin-au-carre
Copy link

Adding this to .zshaliases to display error code

EC() { echo -e ' \e[1;33m'code $?'\e[m'; }
trap EC ERR 

give code 128 when calling git_prompt_info. This is quite annoying since we use git_prompt_info in most themes. Is this possible to get rid of the error code ?

@mcornella
Copy link
Member

This happens on directories that are not inside a git repository. The return statement in line 5 should pass a 0 code, otherwise the return code is the one returned by the git rev-parse command.

ncanceill added a commit to ncanceill/oh-my-zsh that referenced this issue Jun 10, 2014
before, 128 was returned, which could display an error,
but out of a git repo this should exit silently
fixes ohmyzsh#2226
ncanceill added a commit to ncanceill/oh-my-zsh that referenced this issue Jun 10, 2014
before, 128 was returned, which could display an error,
but out of a git repo this should exit silently
fixes ohmyzsh#2226
vdebergue pushed a commit to vdebergue/oh-my-zsh that referenced this issue Jul 1, 2014
* robby/master: (72 commits)
  Basic support for Docker related commands.
  Add Composer's global binaries to PATH
  Add /usr/bin/subl path for who has linked sublime text there
  Plugin jump: autocompletion for numbers and dots
  added useful mvn aliases
  Add spring to bundled commands
  git_prompt_info: ignore git-config errors
  Add missing `command` wrapper for git
  Add missing quotes to within-bundler-project function
  Add pip2 and pip-2.7 support to pip plugin
  Add pip3 completion support to pip plugin
  ignore usernames beginning with underscore
  return 0 when not a git repo before, 128 was returned, which could display an error, but out of a git repo this should exit silently fixes ohmyzsh#2226
  fix root mode not working in bureau
  Autojump plugin: check user local installation first.
  Vundle plugin now works with submodules.
  fixed rvm warning
  New alias for repo: ru and rst
  Add startproject to django command completions
  Adding compression to rsync commands
  ...
jarinudom added a commit to jarinudom/oh-my-zsh that referenced this issue Jul 2, 2014
* 'master' of git://github.com/robbyrussell/oh-my-zsh: (52 commits)
  Basic support for Docker related commands.
  Add Composer's global binaries to PATH
  Add /usr/bin/subl path for who has linked sublime text there
  Plugin jump: autocompletion for numbers and dots
  added useful mvn aliases
  Add spring to bundled commands
  git_prompt_info: ignore git-config errors
  Add missing `command` wrapper for git
  Add missing quotes to within-bundler-project function
  Add pip2 and pip-2.7 support to pip plugin
  Add pip3 completion support to pip plugin
  Add new plugin: "frontend-search"
  ignore usernames beginning with underscore
  return 0 when not a git repo before, 128 was returned, which could display an error, but out of a git repo this should exit silently fixes ohmyzsh#2226
  fix root mode not working in bureau
  Autojump plugin: check user local installation first.
  Vundle plugin now works with submodules.
  fixed rvm warning
  New alias for repo: ru and rst
  Add startproject to django command completions
  ...
gerardo added a commit to gerardo/oh-my-zsh that referenced this issue Jul 3, 2014
* 'master' of git://github.com/robbyrussell/oh-my-zsh: (294 commits)
  Basic support for Docker related commands.
  Add Composer's global binaries to PATH
  Add /usr/bin/subl path for who has linked sublime text there
  Plugin jump: autocompletion for numbers and dots
  added useful mvn aliases
  Add spring to bundled commands
  git_prompt_info: ignore git-config errors
  Add missing `command` wrapper for git
  Add missing quotes to within-bundler-project function
  Add pip2 and pip-2.7 support to pip plugin
  Add pip3 completion support to pip plugin
  Add new plugin: "frontend-search"
  ignore usernames beginning with underscore
  return 0 when not a git repo before, 128 was returned, which could display an error, but out of a git repo this should exit silently fixes ohmyzsh#2226
  fix root mode not working in bureau
  Autojump plugin: check user local installation first.
  Vundle plugin now works with submodules.
  fixed rvm warning
  New alias for repo: ru and rst
  Add startproject to django command completions
  ...

Conflicts:
	README.textile
	tools/install.sh
rsrchboy added a commit to rsrchboy/oh-my-zsh that referenced this issue Jul 4, 2014
* upstream/master: (52 commits)
  Basic support for Docker related commands.
  Add Composer's global binaries to PATH
  Add /usr/bin/subl path for who has linked sublime text there
  Plugin jump: autocompletion for numbers and dots
  added useful mvn aliases
  Add spring to bundled commands
  git_prompt_info: ignore git-config errors
  Add missing `command` wrapper for git
  Add missing quotes to within-bundler-project function
  Add pip2 and pip-2.7 support to pip plugin
  Add pip3 completion support to pip plugin
  Add new plugin: "frontend-search"
  ignore usernames beginning with underscore
  return 0 when not a git repo before, 128 was returned, which could display an error, but out of a git repo this should exit silently fixes ohmyzsh#2226
  fix root mode not working in bureau
  Autojump plugin: check user local installation first.
  Vundle plugin now works with submodules.
  fixed rvm warning
  New alias for repo: ru and rst
  Add startproject to django command completions
  ...
foobacca pushed a commit to foobacca/oh-my-zsh that referenced this issue Jul 5, 2014
* origin/master: (52 commits)
  Basic support for Docker related commands.
  Add Composer's global binaries to PATH
  Add /usr/bin/subl path for who has linked sublime text there
  Plugin jump: autocompletion for numbers and dots
  added useful mvn aliases
  Add spring to bundled commands
  git_prompt_info: ignore git-config errors
  Add missing `command` wrapper for git
  Add missing quotes to within-bundler-project function
  Add pip2 and pip-2.7 support to pip plugin
  Add pip3 completion support to pip plugin
  Add new plugin: "frontend-search"
  ignore usernames beginning with underscore
  return 0 when not a git repo before, 128 was returned, which could display an error, but out of a git repo this should exit silently fixes ohmyzsh#2226
  fix root mode not working in bureau
  Autojump plugin: check user local installation first.
  Vundle plugin now works with submodules.
  fixed rvm warning
  New alias for repo: ru and rst
  Add startproject to django command completions
  ...
freecastle added a commit to freecastle/oh-my-zsh that referenced this issue Jul 7, 2014
* 'master' of https://github.com/robbyrussell/oh-my-zsh: (52 commits)
  Basic support for Docker related commands.
  Add Composer's global binaries to PATH
  Add /usr/bin/subl path for who has linked sublime text there
  Plugin jump: autocompletion for numbers and dots
  added useful mvn aliases
  Add spring to bundled commands
  git_prompt_info: ignore git-config errors
  Add missing `command` wrapper for git
  Add missing quotes to within-bundler-project function
  Add pip2 and pip-2.7 support to pip plugin
  Add pip3 completion support to pip plugin
  Add new plugin: "frontend-search"
  ignore usernames beginning with underscore
  return 0 when not a git repo before, 128 was returned, which could display an error, but out of a git repo this should exit silently fixes ohmyzsh#2226
  fix root mode not working in bureau
  Autojump plugin: check user local installation first.
  Vundle plugin now works with submodules.
  fixed rvm warning
  New alias for repo: ru and rst
  Add startproject to django command completions
  ...
kscott pushed a commit to kscott/oh-my-zsh that referenced this issue Jul 11, 2014
* upstream/master: (296 commits)
  Basic support for Docker related commands.
  Add Composer's global binaries to PATH
  Add /usr/bin/subl path for who has linked sublime text there
  Plugin jump: autocompletion for numbers and dots
  added useful mvn aliases
  Add spring to bundled commands
  git_prompt_info: ignore git-config errors
  Add missing `command` wrapper for git
  Add missing quotes to within-bundler-project function
  Add pip2 and pip-2.7 support to pip plugin
  Add pip3 completion support to pip plugin
  Add new plugin: "frontend-search"
  ignore usernames beginning with underscore
  return 0 when not a git repo before, 128 was returned, which could display an error, but out of a git repo this should exit silently fixes ohmyzsh#2226
  fix root mode not working in bureau
  Autojump plugin: check user local installation first.
  Vundle plugin now works with submodules.
  fixed rvm warning
  New alias for repo: ru and rst
  Add startproject to django command completions
  ...

Conflicts:
	.gitignore
LucasRoesler pushed a commit to LucasRoesler/oh-my-zsh that referenced this issue Jul 22, 2014
before, 128 was returned, which could display an error,
but out of a git repo this should exit silently
fixes ohmyzsh#2226
erwinvaneijk pushed a commit to erwinvaneijk/oh-my-zsh that referenced this issue Sep 8, 2014
before, 128 was returned, which could display an error,
but out of a git repo this should exit silently
fixes ohmyzsh#2226
benjaoming pushed a commit to benjaoming/oh-my-zsh that referenced this issue Nov 28, 2014
before, 128 was returned, which could display an error,
but out of a git repo this should exit silently
fixes ohmyzsh#2226
kenton pushed a commit to kenton/oh-my-zsh that referenced this issue Jan 9, 2015
before, 128 was returned, which could display an error,
but out of a git repo this should exit silently
fixes ohmyzsh#2226
NobbZ pushed a commit to NobbZ/oh-my-zsh that referenced this issue May 15, 2016
before, 128 was returned, which could display an error,
but out of a git repo this should exit silently
fixes ohmyzsh#2226
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants