Skip to contentSkip to conversation

merge errors on 'everything'

DISCUSSION bruno randolf 6 participants 13 messages Jan 9, 2008 – Jan 19, 2008

lore
Share & tools
lore
#0 lore raw

hi!

many times when i do a 'git pull' to update the wireless-2.6 'everything' branch i run into unexplicable merge errors.

i created the branch with 'git co --track -b everything origin/everything' and i don't work on this branch so all files are un-modified.

what am i doing wrong?

bruno

#1 lore raw
Quoted 4 lines · bruno randolf

hi!

many times when i do a 'git pull' to update the wireless-2.6 'everything' branch i run into unexplicable merge errors.

I think the explanation is that the changes in the branch are rebased, rather than merged, when the wireless-2.6 repository is updated from the upstream Linux repository.

git views changes on top of the old tree in your repository as independent from those that appear in wireless-2.6, so it tries to merge them. But since it's actually the same patches, git sees that as a conflict.

You can clean up the consequences of the failed merge by running "git-reset --hard origin/everything" where "origin" is the name of the remote.

Quoted 4 lines

i created the branch with 'git co --track -b everything origin/everything' and i don't work on this branch so all files are un-modified.

what am i doing wrong?

I'm not sure you are doing anything wrong. It's quite possible that git should be changed to handle this problem better. Or maybe the wireless-2.6 repository should be managed differently.

Signature · 2 lines
Regards,
Pavel Roskin
#2 lore raw
Quoted 2 lines · Pavel Roskin

You can clean up the consequences of the failed merge by running "git-reset --hard origin/everything" where "origin" is the name of th=

e

Quoted 1 line

remote.

A failed merge leaves the head of the tree to be merged in MERGE_HEAD, so you can use "git reset --hard MERGE_HEAD" generically.

Andreas.

--=20
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstra=DFe 5, 90409 N=FCrnberg, Germany PGP key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4= ED5
"And now for something completely different."
-
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to bruno randolf
Quoted 9 lines · bruno randolf

hi!

many times when i do a 'git pull' to update the wireless-2.6 'everything' branch i run into unexplicable merge errors.

i created the branch with 'git co --track -b everything origin/everything' and i don't work on this branch so all files are un-modified.

what am i doing wrong?

You'll need to get a fresh clone of the repository -- sorry.

Signature · 2 lines
John W. Linville
[email protected]
#4 lore raw
Quoted 6 lines · John W. Linville
Quoted 5 lines · bruno randolf

hi!

many times when i do a 'git pull' to update the wireless-2.6 'everything' branch i run into unexplicable merge errors.

Quoted 6 lines
Quoted 4 lines

i created the branch with 'git co --track -b everything origin/everything' and i don't work on this branch so all files are un-modified.

what am i doing wrong?

You'll need to get a fresh clone of the repository -- sorry.

While it's reassuring to see that I'm not missing some elegant solution, I think cloning the repository is a major overkill.

"git-reset --hard origin/everything" does the trick for me, while using much less bandwidth and time. It even works with StGIT because it unapplies the patches before pulling and doesn't apply them in case of conflicts. I can apply the StGIT patches after "git-reset".

Signature · 2 lines
Regards,
Pavel Roskin
#5 lore raw
Quoted 4 lines · Pavel Roskin
Quoted 1 line

You'll need to get a fresh clone of the repository -- sorry.

While it's reassuring to see that I'm not missing some elegant solution, I think cloning the repository is a major overkill.

I agree.

Quoted 2 lines

"git-reset --hard origin/everything" does the trick for me, while using much less bandwidth and time.

I do the same and it has worked for me, at least.

It would be nice if git would somehow do this automatically with rebased trees. Or maybe it already supports it and I'm not just aware of it?

Signature · 1 line
Kalle Valo
#6 lore raw
Quoted 6 lines · On Wednesday 09 January 2008 18:05:26 Kalle Valo wrote:
Quoted 4 lines · Pavel Roskin
Quoted 1 line

You'll need to get a fresh clone of the repository -- sorry.

While it's reassuring to see that I'm not missing some elegant solution, I think cloning the repository is a major overkill.

Quoted 6 lines

I agree.

Quoted 2 lines

"git-reset --hard origin/everything" does the trick for me, while using much less bandwidth and time.

I do the same and it has worked for me, at least.

thanks for that hint, but still, that sucks if you want to rebase your local work against an updated 'everything'...

how do you guys manage your pending patches and local work then?

thanks,
bruno

#7 lore raw
Quoted 1 line · bruno randolf

how do you guys manage your pending patches and local work then?

Try StGIT.

Andreas.

--=20
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstra=DFe 5, 90409 N=FCrnberg, Germany PGP key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4= ED5
"And now for something completely different."
-
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw
In reply to bruno randolf
Quoted 9 lines · bruno randolf
Quoted 4 lines
Quoted 2 lines

"git-reset --hard origin/everything" does the trick for me, while using much less bandwidth and time.

I do the same and it has worked for me, at least.

thanks for that hint, but still, that sucks if you want to rebase your local work against an updated 'everything'...

how do you guys manage your pending patches and local work then?

What I have done is that I follow upstream development in master branch and create separate branch for my stuff. And after master changes I'll do 'git rebase master' on my branch.

But as Andreas already mentioned, stgit is the better way to do this.

Signature · 1 line
Kalle Valo
#9 lore raw
In reply to bruno randolf
Quoted 12 lines · bruno randolf
Quoted 11 lines · On Wednesday 09 January 2008 18:05:26 Kalle Valo wrote:
Quoted 4 lines · Pavel Roskin
Quoted 1 line

You'll need to get a fresh clone of the repository -- sorry.

While it's reassuring to see that I'm not missing some elegant solution, I think cloning the repository is a major overkill.

I agree.

Quoted 2 lines

"git-reset --hard origin/everything" does the trick for me, while using much less bandwidth and time.

Quoted 6 lines
Quoted 1 line

I do the same and it has worked for me, at least.

thanks for that hint, but still, that sucks if you want to rebase your local work against an updated 'everything'...

how do you guys manage your pending patches and local work then?

What I recommend is that you start with your own branch from 'everything':

git checkout -b work everything

And for convenience, create another branch representing where you started:

git branch work-start

Now do whatever work you want to do on that branch. You can continue to pull into everything as you like (remember to 'git checkout everything' first) -- I generally try to preserve a continuous everything branch between -rc releases. So long as the pull is clean, you can rebase your work branch quite easily:

git checkout work
git rebase everything

# don't forget to move work-start as well
git branch -D work-start
git branch work-start everything

After a rebase of wireless-2.6#everything, you won't have a clean pull (as you have observed). In that case you can reclone (be sure to save the old clone!) or use git-reset as described above. Then you can use some simple commands to rebase the patches:

git checkout -b new-work everything
git branch new-work-start

git format-patch --stdout work-start..work > work.mbox git am work.mbox

An alternative to the git-format-patch/git-am combination would be to use the attached 'rangepick' script.

Hth!

John

P.S. I have no experience with StGit -- some have said it is functionaly similar to what I describe above yet perhaps simpler to use...YMMV.

Signature · 2 lines
John W. Linville
[email protected]

#!/bin/sh

git log --no-merges $1 | grep ^commit | awk '{ print $2 }' | tac | \
while read commit
do

	if ! git cherry-pick $commit
	then
		echo Failed to cherry-pick commit ${commit}!
		break
	fi

done

#10 lore raw
Quoted 57 lines · On Friday 11 January 2008 00:34:35 John W. Linville wrote:
Quoted 12 lines · bruno randolf
Quoted 11 lines · On Wednesday 09 January 2008 18:05:26 Kalle Valo wrote:
Quoted 4 lines · Pavel Roskin
Quoted 1 line

You'll need to get a fresh clone of the repository -- sorry.

While it's reassuring to see that I'm not missing some elegant solution, I think cloning the repository is a major overkill.

I agree.

Quoted 2 lines

"git-reset --hard origin/everything" does the trick for me, while using much less bandwidth and time.

Quoted 6 lines
Quoted 1 line

I do the same and it has worked for me, at least.

thanks for that hint, but still, that sucks if you want to rebase your local work against an updated 'everything'...

how do you guys manage your pending patches and local work then?

What I recommend is that you start with your own branch from 'everything':

git checkout -b work everything

And for convenience, create another branch representing where you started:

git branch work-start

Now do whatever work you want to do on that branch. You can continue to pull into everything as you like (remember to 'git checkout everything' first) -- I generally try to preserve a continuous everything branch between -rc releases. So long as the pull is clean, you can rebase your work branch quite easily:

git checkout work
git rebase everything

# don't forget to move work-start as well
git branch -D work-start
git branch work-start everything

After a rebase of wireless-2.6#everything, you won't have a clean pull (as you have observed). In that case you can reclone (be sure to save the old clone!) or use git-reset as described above. Then you can use some simple commands to rebase the patches:

git checkout -b new-work everything
git branch new-work-start

git format-patch --stdout work-start..work > work.mbox git am work.mbox

An alternative to the git-format-patch/git-am combination would be to use the attached 'rangepick' script.

Quoted 7 lines

Hth!

John

P.S. I have no experience with StGit -- some have said it is functionaly similar to what I describe above yet perhaps simpler to use...YMMV.

thanks for that! i tried StGIT and it works fine for me, also since i usually have to fixup my patches several times before i send them and it can do that nicely too.

bruno

#11 lore raw
In reply to Kalle Valo
Quoted 6 lines · Kalle Valo

I do the same and it has worked for me, at least.

It would be nice if git would somehow do this automatically with rebased trees. Or maybe it already supports it and I'm not just aware of it?

Why would it? Git isn't designed to handle rebasing nicely -- rebasing is something that should only ever happen if you screw up and have to start again. If you rebase you throw away most of what makes git so useful.

Signature · 1 line
dwmw2
#12 lore raw
Quoted 7 lines · David Woodhouse
Quoted 3 lines

It would be nice if git would somehow do this automatically with rebased trees. Or maybe it already supports it and I'm not just aware of it?

Why would it? Git isn't designed to handle rebasing nicely -- rebasing is something that should only ever happen if you screw up and have to start again.

Maybe in theory, but in practise maintainers rebase a lot. And I, as a git user, have to deal with that and do git reset trickery etc.

Signature · 1 line
Kalle Valo