sources_manager_spec broken when git is set to rebase pulls #1949

Closed
dbgrandi opened this Issue Mar 29, 2014 · 8 comments

Projects

None yet

4 participants

@dbgrandi

The sources_manager_spec parses the output from the git command, but it looks like that has changed in a recent version of git.

This output seems to have changed from Already up-to-date to Current branch master is up to date. sometime before git 1.9.0. This only affects the spec, not the actual lib code.

@segiddins suggested we check the return code from git. I'd have to verify that, but it sounds like a good idea.

@neonichu
Member

Cannot reproduce this with either the git from Xcode 5.1 or latest from brew. Which version are you using exactly?

$ git --version
git version 1.8.5.2 (Apple Git-48)
$ git pull
Already up-to-date.
$ /usr/local/bin/git --version
git version 1.9.1
$ git pull
Already up-to-date.
@dbgrandi

@neonichu I'm using the git 1.9.0 via homebrew, but I figured out that it's not the version that makes the difference. I have git configured to rebase on a pull, and the output of a rebase command is different than the output of a pull command.

Here's the relevant snippet from the CocoaPods/.git/config file:

[branch "master"]
        remote = origin
        merge = refs/heads/master
        rebase = true

That's true for devs who set a global config for branch.autosetuprebase=always and possibly pull.rebase=true, which you can see with git config --global -l

@dbgrandi dbgrandi changed the title from sources_manager_spec broken for new versions of git to sources_manager_spec broken when git is set to rebase pulls Mar 30, 2014
@CocoaPodsBot

Issue has been confirmed by @neonichu

@CocoaPodsBot CocoaPodsBot was unassigned by dbgrandi Mar 30, 2014
@neonichu
Member

Thinking maybe the spec could be changed to disable that option for the test repo it uses.

@fabiopelosin
Member

Can't we just check for /up-?to-?date/? That should do the trick for now

@neonichu
Member

@irrationalfab Other possibility would be explicitly adding --no-rebase to lib/cocoapods/sources_manager.rb, line 155, so that it ignores any git global config for updating spec repos?

@fabiopelosin
Member

Actually that sounds like the best solution: git pull --no-rebase --no-commit

@CocoaPodsBot

@neonichu closed this issue with pull request CocoaPods/CocoaPods#1978

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