Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
alsemyonov opened this Issue · 8 comments

4 participants

@alsemyonov

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

+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

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 paddor referenced this issue from a commit
@paddor paddor avoid process substitution
It might not be supported by a lot of shells. This is the only occurence
of process substitution in this project, and the issue #222 ([1])
mentions a strange syntax error in this file.

[1] #222
000e819
@paddor

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

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

@mislav
Collaborator

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
#!/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
Collaborator

Can't reproduce this! Very strange

@mislav
Collaborator

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.

@mislav mislav closed this
@petervanderdoes petervanderdoes referenced this issue in petervanderdoes/gitflow
Closed

export POSIXLY_CORRECT can be harmful #54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.