Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

pod install often complaining about MERGE_HEAD existing #2024

Closed
rayray opened this Issue Apr 8, 2014 · 9 comments

Comments

Projects
None yet
5 participants

rayray commented Apr 8, 2014

Version: 0.31.1

It's hard for me to reproduce, but I believe every time the specs repo is updated, the next time I attempt to run pod install it fails with this error:

[!] Pod::Executable pull --no-rebase --no-commit

You have not concluded your merge (MERGE_HEAD exists).

Please, commit your changes before you can merge.

The only way to fix this is to:

pod repo remove master
pod setup

@rayray rayray changed the title from pod install often complaining about MERGE_HEAD existing if previous pod install fails to pod install often complaining about MERGE_HEAD existing Apr 8, 2014

Contributor

sguillope commented Apr 15, 2014

I'm having the exact same problem.

To fix it I run the following in the Terminal:

$(cd ~/.cocoapods/repos/master/;git merge --abort)

Not sure if it's related but I have the following in ~/.gitconfig

[merge]
    ff = false
Contributor

sguillope commented Apr 17, 2014

My understanding is that it's not related to the broken Specs repo you linked. This also happens with our private specs repo and we do not use force push.

Every time I run pod update and there are new changes to one of the 2 specs repos, it shows the aforementioned error message. I have to fix it as mentioned in my previous comment.

Now the issue stopped occurring after I changed my git config to be:

[merge]
    ff = true

I'm using Git 1.9.2

Owner

fabiopelosin commented Apr 17, 2014

Thanks for the clarification.

@fabiopelosin fabiopelosin reopened this Apr 17, 2014

Owner

segiddins commented Apr 17, 2014

Should we change the git command to pull --no-rebase --no-commit --ff-only?

Owner

fabiopelosin commented Apr 18, 2014

@segiddins I was considering this option as well... given that now we are in two I think we should go for it.

Owner

segiddins commented Apr 18, 2014

In two?

-Samuel E. Giddins

On Apr 18, 2014, at 1:40 AM, Fabio Pelosin notifications@github.com wrote:

@segiddins I was considering this option as well... given that now we are in two I think we should go for it.


Reply to this email directly or view it on GitHub.

Owner

fabiopelosin commented Apr 18, 2014

This kind of changes tend to introduce subtle and unexpected consequences, like the one described in this ticket. Consequently I prefer to have the confirmation of at least another person about it being reasonable. I.e: now we are in two that think this approach will not introduce unexpected issues.

kylef added a commit that referenced this issue May 2, 2014

[Sources] Use `git pull` with the `--ff-only` flag
This Fixes issue where since we were using `--no-commit`, git was
starting a merge but not committing it. Then subsequent `git pull`'s would
result in the following error from git:

> You have not concluded your merge (MERGE_HEAD exists).
> Please, commit your changes before you can merge.

This commit will mean that `--ff-only` is passed to `git pull`  which means
it wont rebase or merge. It will only allow a fast forward to progress
with the pull.

Fixes #2024
Contributor

kylef commented May 2, 2014

I think there has been a misunderstanding as to what --no-commit does on it's own. When it's used, you might get something like the following:

$ pod install --verbose
  From https://github.com/CocoaPods/Specs
     298c2de..c4fac6c  master     -> origin/master
  Automatic merge went well; stopped before committing as requested

Note, it's actually performed a merge however, stopped so you manually commit the changes.

$ cd ~/.cocoapods/repos/master
$ git status | grep conf
All conflicts fixed but you are still merging.

I've experiencing this issue. Running pod install twice. First succeeds, second fails (with the following) because the first pod install put me in a merge which isn't yet resolved.

Updating spec repo `master`
  $ /usr/bin/git pull --no-rebase --no-commit
  You have not concluded your merge (MERGE_HEAD exists).
  Please, commit your changes before you can merge.
[!] Pod::Executable pull --no-rebase --no-commit

You have not concluded your merge (MERGE_HEAD exists).

Please, commit your changes before you can merge.

The other arguments are unnecessary and I just think we want --ff-only. So I've submitted a pull request which a67e8db which should resolve this issue.

kylef added a commit that referenced this issue May 3, 2014

[Sources] Use `git pull` with the `--ff-only` flag
This Fixes issue where since we were using `--no-commit`, git was
starting a merge but not committing it. Then subsequent `git pull`'s would
result in the following error from git:

> You have not concluded your merge (MERGE_HEAD exists).
> Please, commit your changes before you can merge.

This commit will mean that `--ff-only` is passed to `git pull`  which means
it wont rebase or merge. It will only allow a fast forward to progress
with the pull.

Fixes #2024

@kylef kylef closed this in #2104 May 3, 2014

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