Re: [openstack-dev] Development workflow for bunch of patches

2017-04-20 Thread Jeremy Stanley
On 2017-04-19 15:48:04 -0700 (-0700), Clark Boylan wrote:
[...]
> The way I work is to always edit the tip of the series then "squash
> back" edits as necessary.
> So lets say we already have A <- B <- C and now I want to edit A and
> push everything back so that it is up to date.
> 
> To do this I make a new commit such that A <- B <- C <-D then `git
> rebase -i HEAD~4` and edit the rebase so that I have:
> 
>   pick A
>   squash D
>   pick B
>   pick C
> 
> Then after rebase I end up with A' <- B' <- C' and when I git review all
> three are updated properly in gerrit. The basic idea here is that you
> are working on a series not a single commit so any time you make changes
> you curate the entire series.
[...]

I use a similar solution, but with edit instead of squash:

  edit A
  pick B
  pick C

That drops me into a state where any edits I make and subsequently
git add will be integrated into commit A. Then when I git rebase
--continue I'll be prompted subsequently to resolve any resulting
merge conflicts the rest of the way back up the stack to C (assuming
there are any).
-- 
Jeremy Stanley

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] Development workflow for bunch of patches

2017-04-19 Thread Clark Boylan
On Wed, Apr 19, 2017, at 01:11 AM, Sławek Kapłoński wrote:
> Hello,
> 
> I have a question about how to deal with bunch of patches which depends
> one on another.
> I did patch to neutron (https://review.openstack.org/#/c/449831/
> ) which is not merged yet but I
> wanted to start also another patch which is depend on this one
> (https://review.openstack.org/#/c/457816/
> ).
> Currently I was trying to do something like:
> 1. git review -d 
> 2. git checkout -b new_branch_for_second_patch
> 3. Make second patch, commit all changes
> 4. git review <— this will ask me if I really want to push two patches to
> gerrit so I answered „yes”
> 
> Everything is easy for me as long as I’m not doing more changes in first
> patch. How I should work with it if I let’s say want to change something
> in first patch and later I want to make another change to second patch?
> IIRC when I tried to do something like that and I made „git review” to
> push changes in second patch, first one was also updated (and I lost
> changes made for this one in another branch).
> How I should work with something like that? Is there any guide about that
> (I couldn’t find such)?

The way I work is to always edit the tip of the series then "squash
back" edits as necessary.
So lets say we already have A <- B <- C and now I want to edit A and
push everything back so that it is up to date.

To do this I make a new commit such that A <- B <- C <-D then `git
rebase -i HEAD~4` and edit the rebase so that I have:

  pick A
  squash D
  pick B
  pick C

Then after rebase I end up with A' <- B' <- C' and when I git review all
three are updated properly in gerrit. The basic idea here is that you
are working on a series not a single commit so any time you make changes
you curate the entire series.

Jim Blair even wrote a tool called git-restack to make this sort of
workflow easy. You can pip install it.

Hope this helps,
Clark

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] Development workflow for bunch of patches

2017-04-19 Thread Ihar Hrachyshka
Sometimes it's possible to avoid the stacking, and instead just rely
on Depends-On (usually in those cases where patches touch completely
different files). In that way, you won't need to restack on each
dependency respin. (But you may want to recheck to get fresh results.)
Of course it won't work as you may expect in local git checkout
because it doesn't know about Depends-On tags, so it's of limited
application.

Ihar

On Wed, Apr 19, 2017 at 1:11 AM, Sławek Kapłoński  wrote:
> Hello,
>
> I have a question about how to deal with bunch of patches which depends one
> on another.
> I did patch to neutron (https://review.openstack.org/#/c/449831/) which is
> not merged yet but I wanted to start also another patch which is depend on
> this one (https://review.openstack.org/#/c/457816/).
> Currently I was trying to do something like:
> 1. git review -d 
> 2. git checkout -b new_branch_for_second_patch
> 3. Make second patch, commit all changes
> 4. git review <— this will ask me if I really want to push two patches to
> gerrit so I answered „yes”
>
> Everything is easy for me as long as I’m not doing more changes in first
> patch. How I should work with it if I let’s say want to change something in
> first patch and later I want to make another change to second patch? IIRC
> when I tried to do something like that and I made „git review” to push
> changes in second patch, first one was also updated (and I lost changes made
> for this one in another branch).
> How I should work with something like that? Is there any guide about that (I
> couldn’t find such)?
>
> —
> Best regards
> Slawek Kaplonski
> sla...@kaplonski.pl
>
>
>
>
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] Development workflow for bunch of patches

2017-04-19 Thread Ben Nemec



On 04/19/2017 03:11 AM, Sławek Kapłoński wrote:

Hello,

I have a question about how to deal with bunch of patches which depends
one on another.
I did patch to neutron (https://review.openstack.org/#/c/449831/) which
is not merged yet but I wanted to start also another patch which is
depend on this one (https://review.openstack.org/#/c/457816/).
Currently I was trying to do something like:
1. git review -d 
2. git checkout -b new_branch_for_second_patch
3. Make second patch, commit all changes
4. git review <— this will ask me if I really want to push two patches
to gerrit so I answered „yes”

Everything is easy for me as long as I’m not doing more changes in first
patch. How I should work with it if I let’s say want to change something
in first patch and later I want to make another change to second patch?
IIRC when I tried to do something like that and I made „git review” to
push changes in second patch, first one was also updated (and I lost
changes made for this one in another branch).
How I should work with something like that? Is there any guide about
that (I couldn’t find such)?


I did a few how-to videos on working with patch series in Gerrit.  The 
first one is here: https://www.youtube.com/watch?v=mHyvP7zp4Ko  There 
are some follow-up ones that discuss other things you can do with a 
patch series too.  The full playlist is here: 
https://www.youtube.com/playlist?list=PLR97FKPZ-mD9XJCfwDE5c-td9lZGIPfS5




—
Best regards
Slawek Kaplonski
sla...@kaplonski.pl 





__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] Development workflow for bunch of patches

2017-04-19 Thread Eric Fried
I've always used rebase rather than cherry-pick in this situation.
Bonus is that sometimes (if no conflicts) I can do the rebase in gerrit
with two clicks rather than locally with a bunch of typing.
@kevinbenton, is there a benefit to using cherry-pick rather than rebase?

Thanks,
Eric Fried (efried)

On 04/19/2017 03:39 AM, Sławek Kapłoński wrote:
> Hello,
> 
> Thanks a lot :)
> 
> — 
> Best regards
> Slawek Kaplonski
> sla...@kaplonski.pl 
> 
> 
> 
>> Wiadomość napisana przez Kevin Benton > > w dniu 19.04.2017, o godz. 10:25:
>>
>> Whenever you want to work on the second patch you would need to first
>> checkout the latest version of the first patch and then cherry-pick
>> the later patch on top of it. That way when you update the second one
>> it won't affect the first patch.
>>
>> The -R flag can also be used to prevent unexpected rebases of the
>> parent patch. More details here:
>>
>> https://docs.openstack.org/infra/manual/developers.html#adding-a-dependency
>>
>> On Wed, Apr 19, 2017 at 1:11 AM, Sławek Kapłoński > > wrote:
>>
>> Hello,
>>
>> I have a question about how to deal with bunch of patches which
>> depends one on another.
>> I did patch to neutron (https://review.openstack.org/#/c/449831/
>> ) which is not merged
>> yet but I wanted to start also another patch which is depend on
>> this one (https://review.openstack.org/#/c/457816/
>> ).
>> Currently I was trying to do something like:
>> 1. git review -d 
>> 2. git checkout -b new_branch_for_second_patch
>> 3. Make second patch, commit all changes
>> 4. git review <— this will ask me if I really want to push two
>> patches to gerrit so I answered „yes”
>>
>> Everything is easy for me as long as I’m not doing more changes in
>> first patch. How I should work with it if I let’s say want to
>> change something in first patch and later I want to make another
>> change to second patch? IIRC when I tried to do something like
>> that and I made „git review” to push changes in second patch,
>> first one was also updated (and I lost changes made for this one
>> in another branch).
>> How I should work with something like that? Is there any guide
>> about that (I couldn’t find such)?
>>
>> — 
>> Best regards
>> Slawek Kaplonski
>> sla...@kaplonski.pl 
>>
>>
>>
>>
>> 
>> __
>> OpenStack Development Mailing List (not for usage questions)
>> Unsubscribe:
>> openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
>> 
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>> 
>>
>>
>> __
>> OpenStack Development Mailing List (not for usage questions)
>> Unsubscribe: openstack-dev-requ...@lists.openstack.org
>> ?subject:unsubscribe
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 
> 
> 
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] Development workflow for bunch of patches

2017-04-19 Thread Sławek Kapłoński
Hello,

Thanks a lot :)

— 
Best regards
Slawek Kaplonski
sla...@kaplonski.pl



> Wiadomość napisana przez Kevin Benton  w dniu 19.04.2017, o 
> godz. 10:25:
> 
> Whenever you want to work on the second patch you would need to first 
> checkout the latest version of the first patch and then cherry-pick the later 
> patch on top of it. That way when you update the second one it won't affect 
> the first patch.
> 
> The -R flag can also be used to prevent unexpected rebases of the parent 
> patch. More details here:
> 
> https://docs.openstack.org/infra/manual/developers.html#adding-a-dependency 
> 
> 
> On Wed, Apr 19, 2017 at 1:11 AM, Sławek Kapłoński  > wrote:
> Hello,
> 
> I have a question about how to deal with bunch of patches which depends one 
> on another.
> I did patch to neutron (https://review.openstack.org/#/c/449831/ 
> ) which is not merged yet but I 
> wanted to start also another patch which is depend on this one 
> (https://review.openstack.org/#/c/457816/ 
> ).
> Currently I was trying to do something like:
> 1. git review -d 
> 2. git checkout -b new_branch_for_second_patch
> 3. Make second patch, commit all changes
> 4. git review <— this will ask me if I really want to push two patches to 
> gerrit so I answered „yes”
> 
> Everything is easy for me as long as I’m not doing more changes in first 
> patch. How I should work with it if I let’s say want to change something in 
> first patch and later I want to make another change to second patch? IIRC 
> when I tried to do something like that and I made „git review” to push 
> changes in second patch, first one was also updated (and I lost changes made 
> for this one in another branch).
> How I should work with something like that? Is there any guide about that (I 
> couldn’t find such)?
> 
> — 
> Best regards
> Slawek Kaplonski
> sla...@kaplonski.pl 
> 
> 
> 
> 
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe 
> 
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev 
> 
> 
> 
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] Development workflow for bunch of patches

2017-04-19 Thread Kevin Benton
Whenever you want to work on the second patch you would need to first
checkout the latest version of the first patch and then cherry-pick the
later patch on top of it. That way when you update the second one it won't
affect the first patch.

The -R flag can also be used to prevent unexpected rebases of the parent
patch. More details here:

https://docs.openstack.org/infra/manual/developers.html#adding-a-dependency

On Wed, Apr 19, 2017 at 1:11 AM, Sławek Kapłoński 
wrote:

> Hello,
>
> I have a question about how to deal with bunch of patches which depends
> one on another.
> I did patch to neutron (https://review.openstack.org/#/c/449831/) which
> is not merged yet but I wanted to start also another patch which is depend
> on this one (https://review.openstack.org/#/c/457816/).
> Currently I was trying to do something like:
> 1. git review -d 
> 2. git checkout -b new_branch_for_second_patch
> 3. Make second patch, commit all changes
> 4. git review <— this will ask me if I really want to push two patches to
> gerrit so I answered „yes”
>
> Everything is easy for me as long as I’m not doing more changes in first
> patch. How I should work with it if I let’s say want to change something in
> first patch and later I want to make another change to second patch? IIRC
> when I tried to do something like that and I made „git review” to push
> changes in second patch, first one was also updated (and I lost changes
> made for this one in another branch).
> How I should work with something like that? Is there any guide about that
> (I couldn’t find such)?
>
> —
> Best regards
> Slawek Kaplonski
> sla...@kaplonski.pl
>
>
>
>
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] Development workflow for bunch of patches

2017-04-19 Thread Sławek Kapłoński
Hello,

I have a question about how to deal with bunch of patches which depends one on 
another.
I did patch to neutron (https://review.openstack.org/#/c/449831/ 
) which is not merged yet but I 
wanted to start also another patch which is depend on this one 
(https://review.openstack.org/#/c/457816/ 
).
Currently I was trying to do something like:
1. git review -d 
2. git checkout -b new_branch_for_second_patch
3. Make second patch, commit all changes
4. git review <— this will ask me if I really want to push two patches to 
gerrit so I answered „yes”

Everything is easy for me as long as I’m not doing more changes in first patch. 
How I should work with it if I let’s say want to change something in first 
patch and later I want to make another change to second patch? IIRC when I 
tried to do something like that and I made „git review” to push changes in 
second patch, first one was also updated (and I lost changes made for this one 
in another branch).
How I should work with something like that? Is there any guide about that (I 
couldn’t find such)?

— 
Best regards
Slawek Kaplonski
sla...@kaplonski.pl



__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev