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

error: unknown option `list' when updating/checking out branch #16

Closed
markri opened this issue Jan 15, 2013 · 8 comments
Closed

error: unknown option `list' when updating/checking out branch #16

markri opened this issue Jan 15, 2013 · 8 comments
Labels

Comments

@markri
Copy link

markri commented Jan 15, 2013

    $repo = new Repository('/home/vagrant/myrepo');
    $repo->updateAllBranches();

error: unknown option `list'
usage: git branch [options] [-r | -a] [--merged | --no-merged]
or: git branch [options] [-l] [-f] []
or: git branch [options] [-r](-d | -D)
or: git branch [options](-m | -M) []

at Caller ->execute ('branch '-v' '--list' '--no-color' '--no-abbrev' '-a' 'master'')
in cypresslab/gitelephant/src/GitElephant/Objects/TreeBranch.php at line 111

I use git 1.7.1. on CentOS 6. I guess this library depends on git 1.8.x? Can't figure out when this option was introduced, in documentation of Git it seems like this option is there forever. Also when doing "git branch --help" it doesnt show anything about the "--list" option.

@markri
Copy link
Author

markri commented Jan 15, 2013

Just found out it has a minimal requirement of Git 1.7.8 (concerning the --list option), maybe this could be added in the README.md

@matteosister
Copy link
Owner

Thank you for taking your time reporting this issue.
For the next version of GitElephant the updateAllBranches() method will be removed.
This is because it's really difficult to know what to do without hacking too much.
For example git gives you in the list the remote name (for example develop has origin/develop) even if the origin branch does not actually exists. So maybe it's better to create the "pull" method on Repository and let git do the job.

If you know a way to do this in the right way let me know...

@matteosister
Copy link
Owner

closing...
updateAllBranches has been removed...

@cbulock
Copy link

cbulock commented Feb 23, 2013

It might still be a good idea to mention that git 1.7.8 is required as I am using 1.7.1 and the error is coming up for getBranches() and getMainBranch()

@matteosister
Copy link
Owner

thanks for the info!
I'm gonna find a solution asap...

@matteosister matteosister reopened this Feb 23, 2013
@matteosister
Copy link
Owner

@cbulock there is a new version tagged 0.9.14 that should solve the problem by not using the --list option.

Could you please update and tell me if it works? Many thanks!

@cbulock
Copy link

cbulock commented Feb 23, 2013

Using v0.9.14, I retested getMainBranch() and that now works in both git 1.7.1 and the newer 1.8.2

@matteosister
Copy link
Owner

Great! Thanks...

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

No branches or pull requests

3 participants