[U-Boot] Attn Maintainers: git advise needed (how to fix messed up repo)

Mike Frysinger vapier at gentoo.org
Tue Nov 29 06:36:58 CET 2011


On Tuesday 29 November 2011 00:04:12 Graeme Russ wrote:
> I think I need to do some reading up on 'rebase' versus 'merge' in git

rebase: rewrites the history by taking all of your local changes and placing 
them on top of the commit you've specified.  this ultimately produces a much 
more linear and "clean" history for people to review, but can lose information 
(the exact code base a patch was written against) and be hard to work with 
downstream.

merge: stitches together two related trees that have diverged.  adds a "merge 
commit" to the point where the two histories get stitched together.  things 
are not linear at all :).

> So then the question becomes - what about developers doing x86 work - I
> may have patches published in u-boot-x86/master which have not been pulled
> by Wolfgang, but u-boot/master may also contain patches that are needed

if that's the case, then i think doing a merge with Wolfgang's is acceptable 
if you don't just want to have Wolfgang pull your tree as is

> Can you merge a local repo with multiple remotes? So could developer 'x':

certainly.  that's the great thing about git -- every single git repo is on 
"equal" footing in terms of what can be done regardless of who it is (you, me, 
Wolfgang, random-person-who-has-never-posted-to-the-u-boot-list).  the *only* 
thing preventing changes being published on denx.de are ssh credentials.

> > then you'll have to do:
> >        $ git checkout master
> >        $ git rebase u-boot/master
> >        $ git push --force <remote uri> master
> 
> Hmm, I don't think this will, in and of itself, help - The duplicate
> commits are all local to u-boot-x86/master (they are all x86 patches, not
> u-boot patches) but I'll give it a go first...

rebase should automatically discard changesets that are empty/already applied.  
if it doesn't, use the interactive flag:
	$ git rebase -i u-boot/master
then delete any duplicate lines in the text file that pops up
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20111129/58aec911/attachment.pgp>


More information about the U-Boot mailing list