FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Catalyst

 
 
LinkBack Thread Tools
 
Old 12-09-2011, 04:37 PM
Matt Turner
 
Default rfc: merging catalyst git branches

On Fri, Dec 9, 2011 at 11:16 AM, William Hubbs <williamh@gentoo.org> wrote:
> On Fri, Dec 09, 2011 at 05:42:03AM +0100, Sebastian Pipping wrote:
>> On 12/09/2011 04:19 AM, William Hubbs wrote:
>> > Hi Jorge,
>> >
>> > Ok, no problem, I'll go back to the #git channel tomorrow and
>> > investigate how to do that.
>>
>> Have you received my other mail with notes on git commit-tree and how it
>> can help here? *It was sent "Fri, 09 Dec 2011 00:43:45 +0100".
>
> *Yes, I saw it, but it doesn't seem to do what we want. It merges the
> *branches together instead of swapping them.
>
>> > I would prefer to do it without merge commits if possible
>
> What I want is something like:
>
> git branch -m master catalyst_3
> git branch -m catalyst_2 master
> # now update the upstream repo to match this.
> # I'm not sure if this will cause a forced update or not though.
>
>>
>> What would be the gain here?
>
> *The gain is that git log doesn't show a merge commit, and you aren't
> *pushing another 70 plus commits to the master branch, so you keep the
> *history clean.

What Sebastian was suggesting was this, which works (I just verified locally)

git checkout master
git branch catalyst_3 # creates a branch identical to master called catalyst_3
git branch -M catalyst_2 master # renames the catalyst_2 branch to master
 
Old 12-09-2011, 05:38 PM
Sebastian Pipping
 
Default rfc: merging catalyst git branches

On 12/09/2011 06:37 PM, Matt Turner wrote:
> What Sebastian was suggesting was this, which works (I just verified locally)
>
> git checkout master
> git branch catalyst_3 # creates a branch identical to master called catalyst_3
> git branch -M catalyst_2 master # renames the catalyst_2 branch to master

No, step three uses git commit-tree and git merge in my approach -- it's
not a rename.




Sebastian
 
Old 12-09-2011, 05:48 PM
Sebastian Pipping
 
Default rfc: merging catalyst git branches

On 12/09/2011 05:16 PM, William Hubbs wrote:
> Yes, I saw it, but it doesn't seem to do what we want. It merges the
> branches together instead of swapping them.

Maybe it's not what _you_ want, but it does

- make catalyst_2 content appear on master

- doesn't break fast forward "git pull" for anyone

- supports branching catalyst_2 off master, too

So besides the merge commit, this can look like rename from the outside.


>>> I would prefer to do it without merge commits if possible
>
> What I want is something like:
>
> git branch -m master catalyst_3
> git branch -m catalyst_2 master
> # now update the upstream repo to match this.
> # I'm not sure if this will cause a forced update or not though.

It does, a forced push would be necessary:
you are pushing commits to master that are not successors of the remote
master's HEAD.


>> What would be the gain here?
>
> The gain is that git log doesn't show a merge commit, and you aren't
> pushing another 70 plus commits to the master branch, so you keep the
> history clean.

A clean history is *not* a history without merge commits but a history
reflecting what happened in reality. There are cases where it makes
sens to even force a merge commit using git merge --no-ff to clearly
indicate that a dedicated branch was merged back.

Best,



Sebastian
 
Old 12-10-2011, 01:45 PM
William Hubbs
 
Default rfc: merging catalyst git branches

On Fri, Dec 09, 2011 at 07:48:52PM +0100, Sebastian Pipping wrote:
> On 12/09/2011 05:16 PM, William Hubbs wrote:
> > Yes, I saw it, but it doesn't seem to do what we want. It merges the
> > branches together instead of swapping them.
>
> Maybe it's not what _you_ want, but it does
>
> - make catalyst_2 content appear on master
>
> - doesn't break fast forward "git pull" for anyone
>
> - supports branching catalyst_2 off master, too

The method you are suggesting does _NOT_ make the current content of
master appear on catalyst_3, which is the other part of what releng is
requesting.

What I think I can do, but I'm not quite sure how to do it, is:

1) create a catalyst_3 branch at the same point in history where
catalyst_2 was created. I believe I can accomplish this with

git branch catalyst_3 $(git merge-base master catalyst_2)

2) put the code on master that is _NOT_ on catalyst_2 on catalyst_3.

Any suggestions for how to do this?

3) put the code on catalyst_2 on master.

What about this?

William
 
Old 12-10-2011, 09:15 PM
Sebastian Pipping
 
Default rfc: merging catalyst git branches

On 12/10/2011 03:45 PM, William Hubbs wrote:
>> - supports branching catalyst_2 off master, too

s/catalyst_2/catalyst_3/


> The method you are suggesting does _NOT_ make the current content of
> master appear on catalyst_3, which is the other part of what releng is
> requesting.

That's a trivial addition. With it, the full run on my shell:

# git branch catalyst_3 master

# git checkout master

# git merge $(git commit-tree catalyst_2^{tree}
-p catalyst_2 -p master
<<<"Replace content on master with content from catalyst_2")

# git push origin master

# git push origin catalyst_3


Results is:

- 2.x content on branch master (and catalyest_2)

- 3.x content on branch catalyest_3


> What I think I can do, but I'm not quite sure how to do it, is:
>
> 1) create a catalyst_3 branch at the same point in history where
> catalyst_2 was created. I believe I can accomplish this with
>
> git branch catalyst_3 $(git merge-base master catalyst_2)

The branch head is moving along with each commit so it would end up at
the current master in the end, anyway.

If you like to mark the point where catalyst 3.x was started, a tag
would be the right tool, not a branch.


> 2) put the code on master that is _NOT_ on catalyst_2 on catalyst_3.
>
> Any suggestions for how to do this?

I'm not sure what you mean by that.


> 3) put the code on catalyst_2 on master.
>
> What about this?

Either git commit-tree or forced push.

Best,



Sebastian
 
Old 12-10-2011, 11:35 PM
Peter Stuge
 
Default rfc: merging catalyst git branches

Sebastian Pipping wrote:
> > 3) put the code on catalyst_2 on master.
> >
> > What about this?
>
> Either git commit-tree or forced push.

git commit-tree is the better way. Sometimes it is neccessary to
rewrite public history, but this is not one of those times.

Whenever it is not absolutely neccessary, it's better to do something
else on the branch than rewrite it - unless the branch is well known
to be rewritten (like a testing branch might be).

catalyst master is not a testing branch and shouldn't be rewritten.

William, please go with Sebastian's suggestion.


//Peter
 
Old 06-24-2012, 11:33 PM
Sebastian Pipping
 
Default rfc: merging catalyst git branches

On 12/10/2011 11:15 PM, Sebastian Pipping wrote:
> [T]he full run on my shell:
>
> # git branch catalyst_3 master
>
> # git checkout master
>
> # git merge $(git commit-tree catalyst_2^{tree}
> -p catalyst_2 -p master
> <<<"Replace content on master with content from catalyst_2")
>
> # git push origin master
>
> # git push origin catalyst_3
>
>
> Results is:
>
> - 2.x content on branch master (and catalyst_2)
>
> - 3.x content on branch catalyst_3

This procedure above is still left to do. Any objections?
With no objections, I will go forward on next monday (2012-07-02).

Best,



Sebastian
 
Old 06-25-2012, 04:04 AM
Matt Turner
 
Default rfc: merging catalyst git branches

On Sun, Jun 24, 2012 at 7:33 PM, Sebastian Pipping <sping@gentoo.org> wrote:
> On 12/10/2011 11:15 PM, Sebastian Pipping wrote:
>> [T]he full run on my shell:
>>
>> *# git branch catalyst_3 master
>>
>> *# git checkout master
>>
>> *# git merge $(git commit-tree catalyst_2^{tree}
>> * * *-p catalyst_2 -p master
>> * * *<<<"Replace content on master with content from catalyst_2")
>>
>> *# git push origin master
>>
>> *# git push origin catalyst_3
>>
>>
>> Results is:
>>
>> *- 2.x content on branch master (and catalyst_2)
>>
>> *- 3.x content on branch catalyst_3
>
> This procedure above is still left to do. *Any objections?
> With no objections, I will go forward on next monday (2012-07-02).

If you're confident it'll work -- please proceed. No use in waiting.
 
Old 07-02-2012, 02:55 PM
Sebastian Pipping
 
Default rfc: merging catalyst git branches

On 06/25/2012 06:04 AM, Matt Turner wrote:
> On Sun, Jun 24, 2012 at 7:33 PM, Sebastian Pipping <sping@gentoo.org> wrote:
>> On 12/10/2011 11:15 PM, Sebastian Pipping wrote:
>>> [T]he full run on my shell:
>>>
>>> # git branch catalyst_3 master
>>>
>>> # git checkout master
>>>
>>> # git merge $(git commit-tree catalyst_2^{tree}
>>> -p catalyst_2 -p master
>>> <<<"Replace content on master with content from catalyst_2")
>>>
>>> # git push origin master
>>>
>>> # git push origin catalyst_3
>>>
>>>
>>> Results is:
>>>
>>> - 2.x content on branch master (and catalyst_2)
>>>
>>> - 3.x content on branch catalyst_3
>>
>> This procedure above is still left to do. Any objections?
>> With no objections, I will go forward on next monday (2012-07-02).
>
> If you're confident it'll work -- please proceed. No use in waiting.

Done.

Best,



Sebastian
 
Old 07-02-2012, 09:00 PM
Matt Turner
 
Default rfc: merging catalyst git branches

On Mon, Jul 2, 2012 at 10:55 AM, Sebastian Pipping <sping@gentoo.org> wrote:
> Done.

Great. Thank you, Sebastian. I was able to git pull my branches and
didn't have any trouble.

Matt
 

Thread Tools




All times are GMT. The time now is 09:43 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org