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

Strange syntax error in rbenv-version-file-read \w git-flow #222

Closed
alsemyonov opened this issue May 6, 2012 · 11 comments
Closed

Strange syntax error in rbenv-version-file-read \w git-flow #222

alsemyonov opened this issue May 6, 2012 · 11 comments

Comments

@alsemyonov
Copy link

I don't know, whetther it is rbenv of git-flow problem, but when I try to run

git flow release finish 0.1.0

there is a problem, mentioning rbenv:

Switched to branch 'production'
/Users/alsemyonov/.rbenv/libexec/rbenv-version-file-read: line 16: syntax error near unexpected token `<'
Deleted branch release/0.1.0 (was 1234567).

...

And periodically it causes git-flow commands to fail.

@codebeige
Copy link

+1

When I try something like:

git flow feature start my-cool-feature

I get:

Switched to a new branch 'feature/my-cool-feature'
/usr/local/Cellar/rbenv/0.3.0/libexec/rbenv-version-file-read: line 16: syntax error near unexpected token `<'
Could not create feature branch 'feature/my-cool-feature'

@codebeige
Copy link

At least in my case this is due to a post-checkout hook that calls bundle. Removing the automatic execution of bundle fixed it for the time being.

@paddor
Copy link

paddor commented Jun 25, 2012

It might be that your shells don't support process substitution. It's the only occurence of process substitution used in rbenv. I just changed it to use a simple pipeline. I'll submit a pull request.

@codebeige
Copy link

Sounds reasonable to me. Git flow uses sh under the hood.

@mislav
Copy link
Member

mislav commented Dec 13, 2012

Can you share with us your post-checkout hook that calls bundle? I'm wondering what's going on here

And sorry for not getting onto this until this late. Let's fix it if there's a bug!

@codebeige
Copy link

#!/bin/zsh

.git/hooks/ctags >/dev/null 2>&1 &

if [ $1 != 0000000000000000000000000000000000000000 ]; then
  if command -v hookup >/dev/null; then
    hookup post-checkout "$@"
  elif [ $3 = 1 -a -f Gemfile ] && command -v bundle >/dev/null &&
    git diff --name-only $1 $2 | egrep -q '^Gemfile|\.gemspec$'
  then
    (unset GIT_DIR; exec bundle) | grep -v '^Using ' | grep -v ' is complete'
    true
  fi
fi

@mislav
Copy link
Member

mislav commented Dec 21, 2012

Can't reproduce this! Very strange

@mislav
Copy link
Member

mislav commented Dec 21, 2012

Managed to reproduce, and filed as nvie/gitflow#289

There is no workaround apart from manually editing the git-flow executable and removing the offending line.

@counterbeing
Copy link

I'm actually running into this exact issue myself. I have one git hook in my project, and I tried removing it, but for some reason it's still choking on

/usr/local/Cellar/rbenv/0.4.0/libexec/rbenv-version-file-read: line 17: syntax error near unexpected token `<'

I generally run Zsh, but in the process of troubleshooting, I've also attempted this in bash, with the same result.

@paddor
Copy link

paddor commented Oct 16, 2015

@counterbeing Can't remember if I actually got it to run back then, but I'm using https://github.com/postmodern/chruby by now. :) Works very well.

@counterbeing
Copy link

Thanks for the response! I really am fond of my current rbenv setup though, and don’t want to abandon. Thanks again!

On Oct 16, 2015, at 1:44 PM, Patrik Wenger notifications@github.com wrote:

@counterbeing https://github.com/counterbeing Can't remember if I actually got it to run back then, but I'm using https://github.com/postmodern/chruby https://github.com/postmodern/chruby by now. :) Works very well.


Reply to this email directly or view it on GitHub #222 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants