ohmyzsh: Git plugin freaks out when there's a conflict

I did a git rebase master which resulted in a conflict. And now every time I hit enter at the zsh prompt, I get this:

VCS_INFO_get_data_git:223: no such file or directory: .git/rebase-apply/msg-clean

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 35 (17 by maintainers)

Commits related to this issue

Most upvoted comments

TL;DR: Homebrew zsh 5.2 has the fix; it’s your chsh and not your $PATH that probably matters.

@apjanke is it possible that there is an issue with Homebrew here? Can you try to reproduce this as well?

I can reproduce this on my OS X 10.11.6 machine, but only with the system-supplied zsh 5.0.8. I have an updated Homebrew-installed zsh 5.2, and it is not affected. So it looks like the Homebrew version includes the fix. To be affected, you also need to be using a theme that uses zsh’s supplied vcs_info instead of OMZ’s own git theming support, such as the pure theme.

openssl git/man-page-formatting*
❯ pwd
/Users/janke/local/repos/openssl/openssl
VCS_INFO_get_data_git:223: no such file or directory: .git/rebase-apply/msg-clean

openssl git/man-page-formatting*
❯ echo $ZSH_VERSION
5.0.8
VCS_INFO_get_data_git:223: no such file or directory: .git/rebase-apply/msg-clean

openssl git/man-page-formatting*
❯ zsh

openssl git/man-page-formatting*
❯ pwd
/Users/janke/local/repos/openssl/openssl

openssl git/man-page-formatting*
❯ echo $ZSH_VERSION
5.2

openssl git/man-page-formatting*
❯

There’s a possible interaction with Homebrew, insofar as you may not be running the Homebrew-installed zsh in new terminal sessions, regardless of what which zsh gives you inside a session. This means that zsh --version is not necessarily the one you’re running. The first zsh in a new terminal session is controlled by your chsh setting. Use echo $ZSH_VERSION to see what version the current session is running.

For example, I’m on OS X 10.11.6, and I have zsh 5.2 installed via Homebrew. But I still get the system zsh 5.0.8 by default, since I have /bin/zsh as my default shell.

$ which zsh
/usr/local/bin/zsh
[~]
$ zsh --version
zsh 5.2 (x86_64-apple-darwin13.4.0)
[~]
$ echo $ZSH_VERSION
5.0.8

If that’s your issue, and you want to use the newer 5.2 zsh by default, do a chsh -s $(homebrew --prefix)/bin/zsh (after making sure it’s in your /etc/shells file). @WayneYe, I suspect this is your situation, since you mentioned updating /etc/shells but not running a chsh. I’d guess this is true for others here, since you’re checking the version with zsh --version and not $ZSH_VERSION.

Or, your terminal emulator might be set up to run a specific zsh as your login shell, and it could be pointing to /bin/zsh instead of /usr/local/bin/zsh. If that’s the case, I’d just switch your terminal profile to using your default login shell, so it respects your chsh settings.

And thank you Marc!

Installing the latest zsh (zsh 5.2 (x86_64-apple-darwin15.4.0)) did not fix the error for me.

Ok everyone please check you’re running 5.2 with echo $ZSH_VERSION. If it’s not, run chsh -s /usr/local/bin/zsh.

Just a little feedback from my problem.

I didn’t have echo $ZSH_VERSION 5.2 instead I had 5.0. I installed the latest version from Brew but I had to add /usr/local/bin/zsh to /etc/shells and then everything was working fine.

+1 for @jtheoof

Issue still exist for sure!

I installed latest zsh 5.2 and updated my /etc/shells, i am using OSX El Capitan v10.11.6, below is my environment:

>  which zsh
/usr/local/bin/zsh
>  echo $SHELL
/usr/local/bin/zsh
>  zsh --version
zsh 5.2 (x86_64-apple-darwin15.4.0)
>  git --version
git version 2.9.2

What I got:

> git status
rebase in progress; onto a752d68
You are currently rebasing branch 'prod' on 'a752d68'.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)

Unmerged paths:
  (use "git reset HEAD <file>..." to unstage)
  (use "git add <file>..." to mark resolution)

    both modified:   .travis.yml

no changes added to commit (use "git add" and/or "git commit -a")
VCS_INFO_get_data_git:223: no such file or directory: .git/rebase-apply/msg-clean

On Linux Mint/Ubuntu U got:

zsh 5.1.1 (x86_64-ubuntu-linux-gnu)
60bec9ba8aa6f76ce605239846211159a5a20f1c  /usr/share/zsh/functions/VCS_Info/Backends/VCS_INFO_get_data_git
VCS_INFO_get_data_git:225: no such file or directory: /data/projects/coaxis-opt/.git/rebase-apply/msg-clean

Is there a PPA with ZSH for ubuntu to upgrade to 5.2 ?

Relevant parts of my $PATH is /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin, so I should be good (only nvm and rvm before it)

This is a bug in zsh’s codebase, fixed in https://github.com/zsh-users/zsh/commit/7a1678767f44f200295d88dfea94902718275266. If you can, update your zsh to 5.2.