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

Git plugin freaks out when there's a conflict #4932

Closed
ffxsam opened this issue Mar 18, 2016 · 35 comments
Closed

Git plugin freaks out when there's a conflict #4932

ffxsam opened this issue Mar 18, 2016 · 35 comments

Comments

@ffxsam
Copy link

ffxsam commented Mar 18, 2016

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
@mcornella
Copy link
Member

This is a bug in zsh's codebase, fixed in zsh-users/zsh@7a16787. If you can, update your zsh to 5.2.

@ffxsam
Copy link
Author

ffxsam commented Mar 19, 2016

How do I tell which version I currently have? And how do I update to a specific version?

@mcornella
Copy link
Member

zsh --version gets you the version of zsh. Updating it depends on whatever your operating system is.

@ffxsam
Copy link
Author

ffxsam commented Mar 19, 2016

Oh, I was thinking oh-my-zsh, not zsh. Got it. I'm using zsh 5.2.

@hckuo2
Copy link

hckuo2 commented May 3, 2016

+1

@mcornella
Copy link
Member

This should be in the latest version of zsh 5.2. Perhaps your platform hasn't shipped a modified version of 5.2. For instance, I'm using Debian testing and my installed zsh package is version 5.2-5, meaning it's the 5th or 6th modified version of zsh 5.2. What system are you using?

@mcornella mcornella reopened this May 29, 2016
@ffxsam
Copy link
Author

ffxsam commented May 29, 2016

Mac OS 10.11.5. zsh 5.2 (x86_64-apple-darwin15.4.0). Installed via Homebrew.

@mcornella
Copy link
Member

mcornella commented May 29, 2016

That's weird, the latest Homebrew formula was updated on April 9 and the tar.gz from sourceforge was last updated on December 2015, both long after the fix was introduced to the 5.2 version of zsh. Perhaps you can brew update zsh, or uninstall then install back again?

@SimenB
Copy link
Contributor

SimenB commented Jun 8, 2016

I'm having the same problem, installing and reinstalling from homebrew doesn't do anything (it's the same version)

gabebw added a commit to gabebw/dotfiles that referenced this issue Jun 10, 2016
@jtheoof
Copy link
Contributor

jtheoof commented Jun 29, 2016

@SimenB looks like your $PATH is off.

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

If you see /usr/bin first then you will not see the one installed by Homebrew. See the doc.

@jtheoof
Copy link
Contributor

jtheoof commented Jun 29, 2016

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

@SimenB
Copy link
Contributor

SimenB commented Jun 30, 2016

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)

@WayneYe
Copy link

WayneYe commented Jul 26, 2016

+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

@js3692
Copy link

js3692 commented Aug 11, 2016

+1

1 similar comment
@esgott
Copy link

esgott commented Aug 16, 2016

+1

@mcornella
Copy link
Member

To everyone that has this problem, please run the following and post the output:

zsh --version
for d ($fpath); do
    f="$d/VCS_INFO_get_data_git"
    if [[ -f "$f" ]]; then
        command shasum "$f"
    fi
done

@esgott
Copy link

esgott commented Aug 16, 2016

zsh 5.2 (x86_64-apple-darwin15.0.0)

123fbb5938bd16a8aa0c92a5df9ede62ead06dd1  /usr/share/zsh/5.0.8/functions/VCS_INFO_get_data_git

I think this explains the behaviour. Looking at my fpath variable, there are multiple elements for the old version on OSX

@mcornella
Copy link
Member

Wait... There isn't a 5.2.0 VCS_INFO_... file?

@esgott
Copy link

esgott commented Aug 16, 2016

@mcornella There is, but the zsh functions directory from 5.2 was not in the fpath variable. I think it is a Homebrew package bug. Do you agree?

@mcornella
Copy link
Member

I'm not sure actually. Try running zsh -f and looking at what $fpath is.

@esgott
Copy link

esgott commented Aug 16, 2016

This is my fpath, sourceing oh-my-zsh from my .zshrc is commented out

 $ echo $fpath
/usr/local/share/zsh/site-functions /usr/share/zsh/site-functions /usr/share/zsh/5.0.8/functions

@js3692
Copy link

js3692 commented Aug 16, 2016

@mcornella:

This is the output:
zsh 5.2 (x86_64-apple-darwin15.4.0)
123fbb5938bd16a8aa0c92a5df9ede62ead06dd1 /usr/share/zsh/5.0.8/functions/VCS_INFO_get_data_git

And $fpath:
/usr/local/share/zsh/site-functions /usr/local/Cellar/zsh/5.2/share/zsh/functions

Any ideas...?

@mcornella
Copy link
Member

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

BTW I never got to congratulate you about your promotion as official collaborator at Homebrew so... congrats! 👏

@SimenB
Copy link
Contributor

SimenB commented Aug 17, 2016

zsh --version => zsh 5.2 (x86_64-apple-darwin15.4.0)

The loop => 123fbb5938bd16a8aa0c92a5df9ede62ead06dd1 /usr/share/zsh/5.0.8/functions/VCS_INFO_get_data_git

$fpath without oh-my-zsh stuff => /usr/local/share/zsh/site-functions /usr/share/zsh/site-functions /usr/share/zsh/5.0.8/functions

@jtheoof
Copy link
Contributor

jtheoof commented Aug 17, 2016

$ zsh --version
zsh 5.0.8 (x86_64-apple-darwin15.0)
$ for d ($fpath); do
    f="$d/VCS_INFO_get_data_git"
    if [[ -f "$f" ]]; then
        command shasum "$f"
    fi
done
123fbb5938bd16a8aa0c92a5df9ede62ead06dd1  /usr/share/zsh/5.0.8/functions/VCS_INFO_get_data_git
$ cat -n /usr/share/zsh/5.0.8/functions/VCS_INFO_get_data_git | ag '^\s*223'
   223      subject="${$(< "${patchdir}/msg-clean")[(f)1]}"

@apjanke
Copy link
Contributor

apjanke commented Aug 17, 2016

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!

@mcornella
Copy link
Member

mcornella commented Aug 17, 2016

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

@WayneYe
Copy link

WayneYe commented Aug 17, 2016

@apjanke you are super! your solution fixed this problem!!

@ffxsam
Copy link
Author

ffxsam commented Aug 18, 2016

@apjanke And all this time I was using the wrong binary (/bin/zsh)! Thanks for this!

@mcornella
Copy link
Member

Ok I'll close this issue for now. If someone else can't solve it I'll reopen. Thanks Andrew!

@yordis
Copy link

yordis commented Aug 30, 2016

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.

@thitami
Copy link

thitami commented Jan 13, 2017

I came across this issue while a tried a git rebase today. I am on a MAC OSX El Capitan and this is the trace:

 $ brew install --without-etcdir zsh
Updating Homebrew...
Warning: zsh-5.3.1 already installed

$ dscl . -read /Users/$USER UserShell
UserShell: /usr/local/bin/zsh

$ which zsh
/bin/zsh
 $ zsh --version
 zsh 5.0.8 (x86_64-apple-darwin15.0)

Changing shell...

$chsh -s /usr/local/bin/zsh
Changing shell for thitami.
Password for thitami:
chsh: no changes made

$ sudo vim /etc/shells
....
/bin/zsh
/usr/local/bin/zsh

Any thoughts would be appreciated.

Update: A terminal restart is required for the changes to get applied. All works fine. 👍

@kunkun-tang
Copy link

+1

@edouard-lopez
Copy link

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 ?

@danedmunds
Copy link

Just to help people more...
Using mcornella's tip (echo $ZSH_VERSION) I was able to figure out that I was actually running an old zsh version but chsh -s /usr/local/bin/zsh wasn't working for me. This finally did it for me: https://stackoverflow.com/questions/17648621/how-do-i-update-zsh-to-the-latest-version

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

No branches or pull requests