felipec / git-remote-hg

Transparent bidirectional bridge between Git and Mercurial for Git
GNU General Public License v2.0
369 stars 87 forks source link

pushes are rejected with a non-fast-forward error. #36

Closed urkle closed 5 years ago

urkle commented 9 years ago

So, I've been trying to push a single commit to an HG repository.. And I've re-cloned it 3 times so far from scratch and it's refusing to work. Here are the steps.

  1. git clone hg::https://user:pass@reposite/repo repo
  2. cd repo
  3. git co branches/default
  4. git am < ../0001-my-patch
  5. git push origin branches/default

What I see is a bunch of errors about object already having a mark (see #16 ).. though if I do a push as step 3a.. I can get those out of the way before hand. then I see this.

searching for changes
no changes found
searching for changes
To hg::https://user:pass@reposite/repo
 ! [rejected]        branches/default -> branches/default (non-fast-forward)
error: failed to push some refs to 'hg::https://user:pass@reposite/repo'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

However things are not behind at all!.. And here's the "fun bit" when I try to push again.. this is what happens.

searching for changes
no changes found
Everything up-to-date

As the commit that is supposed to be pushed to the remote is ON the hg repo in .git/hg/origin but not up on the remote server.

HG version 2.4.1 and git version 1.8.1.4 Note that I have been able to commit and push before from this system. So I have no idea why it is breaking now.

Now.. looking at the raw .hg data the branchheads has 3 "default" entries in it? could this be the cause of this?

felipec commented 8 years ago

You are running an ancient version of Git. There has been many fixes in the way remote helper errors are handled in more recent versions.

UltimateBrent commented 7 years ago

This is also happening with me: Git 2.7.4, Hg 3.7.3.

If I git pull before my next commit and push, then it works fine albeit slowly. I'm only having this trouble on the repo where the default branch is named "live" instead of "default". I don't know if that's relevant.

felipec commented 5 years ago

Anybody still experiencing this?