You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Nicolas Lalevée <ni...@hibnet.org> on 2015/01/07 00:38:20 UTC

Git workflow

Hi guys,

I am discovering a little bit of the extends of git, and it seems there are a lot of ways to handle branches and pull requests. Maybe we should all use the same way ?

For instance, to get commits from one branch to the other, I have seen two ways: via merge or via cherry-pick.
Since our branches are meant to diverge à some point, I think using cherry-pick should be used, right ?

And about merging pull request, there is the direct pull, for instance:
git pull https://github.com/jbaruch/ant-ivy <https://github.com/jbaruch/ant-ivy> patch-1

And there is the rebase way, exemple:
git remote add jbaruch https://github.com/jbaruch/ant-ivy
git checkout -b patch-1 jbaruch/patch-1
git rebase master
git checkout master
git merge --ff-only patch-1

I prefer the later one, because it produce a linear history, even if it quite painful on the command line. Any preferences ? Am I wrong ? Is there other options ?

Nicolas


Re: Git workflow

Posted by Stefan Bodewig <bo...@apache.org>.
On 2015-01-12, Nicolas Lalevée wrote:

> I’m not sure though why some of my commits didn’t get to do it:
> https://github.com/apache/ant-ivy/commit/3f9eb02b76c31665b6ff44b11d4017f08065f4f3 <https://github.com/apache/ant-ivy/commit/3f9eb02b76c31665b6ff44b11d4017f08065f4f3>

github isn't tracking master as the default branch for ant-ivy but 1.4.x
- you need a JIRA ticket for infra to change that.  Maybe PRs are only
closed once the commit becomes part of the default branch (I'm
guessing).

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Git workflow

Posted by Stefan Bodewig <bo...@apache.org>.
On 2015-01-12, Nicolas Lalevée wrote:

> I’m not sure though why some of my commits didn’t get to do it:
> https://github.com/apache/ant-ivy/commit/3f9eb02b76c31665b6ff44b11d4017f08065f4f3 <https://github.com/apache/ant-ivy/commit/3f9eb02b76c31665b6ff44b11d4017f08065f4f3>

No idea either, sorry.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Git workflow

Posted by Nicolas Lalevée <ni...@hibnet.org>.
> Le 11 janv. 2015 à 18:46, Stefan Bodewig <bo...@apache.org> a écrit :
> 
> On 2015-01-11, Nicolas Lalevée wrote:
> 
>> By the way, is there any way to close manually the pull requests in
>> github ? The only way is to reference it in a git commit ?
> 
> Probably some infra folks can since you need write access to the github
> apache organization.
> 
> You can create empty commits (--allow-empty), I've done so for one
> invalid PR already.

Ok, good to know.

I’m not sure though why some of my commits didn’t get to do it:
https://github.com/apache/ant-ivy/commit/3f9eb02b76c31665b6ff44b11d4017f08065f4f3 <https://github.com/apache/ant-ivy/commit/3f9eb02b76c31665b6ff44b11d4017f08065f4f3>
https://github.com/apache/ant-ivy/commit/6b2eba430bd7abdef4e9c7851acf6b2c2459cb6d <https://github.com/apache/ant-ivy/commit/6b2eba430bd7abdef4e9c7851acf6b2c2459cb6d>

Nicolas


Re: Git workflow

Posted by Stefan Bodewig <bo...@apache.org>.
On 2015-01-11, Nicolas Lalevée wrote:

> By the way, is there any way to close manually the pull requests in
> github ? The only way is to reference it in a git commit ?

Probably some infra folks can since you need write access to the github
apache organization.

You can create empty commits (--allow-empty), I've done so for one
invalid PR already.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Git workflow

Posted by Nicolas Lalevée <ni...@hibnet.org>.
By the way, is there any way to close manually the pull requests in github ? The only way is to reference it in a git commit ?

Nicolas

> Le 11 janv. 2015 à 13:17, Nicolas Lalevée <ni...@hibnet.org> a écrit :
> 
> 
>> Le 7 janv. 2015 à 05:57, Stefan Bodewig <bo...@apache.org> a écrit :
>> 
>> On 2015-01-07, Nicolas Lalevée wrote:
>> 
>>> For instance, to get commits from one branch to the other, I have seen
>>> two ways: via merge or via cherry-pick.
>>> Since our branches are meant to diverge à some point, I think using
>>> cherry-pick should be used, right ?
>> 
>> Alternatively develop the feature on a third branch, merge that branch
>> into both others and delete the feature branc afterwards.
> 
> Yep, that is a great feature of git too.
> 
>> 
>>> And about merging pull request, there is the direct pull, for instance:
>>> git pull https://github.com/jbaruch/ant-ivy
>>> <https://github.com/jbaruch/ant-ivy> patch-1
>> 
>>> And there is the rebase way, exemple:
>> 
>> The approach I've seen taken a lot on github is to have the submitter of
>> the pull request rebase (and squash) the PR before you merge it.
>> Squashing means you juts get a single clean commit rather than a
>> sequence of refinements.
> 
> Ok.
> I find it strange that there is not a simpler way to do it from the merger point of view.
> 
> Nicolas
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Git workflow

Posted by Nicolas Lalevée <ni...@hibnet.org>.
> Le 7 janv. 2015 à 05:57, Stefan Bodewig <bo...@apache.org> a écrit :
> 
> On 2015-01-07, Nicolas Lalevée wrote:
> 
>> For instance, to get commits from one branch to the other, I have seen
>> two ways: via merge or via cherry-pick.
>> Since our branches are meant to diverge à some point, I think using
>> cherry-pick should be used, right ?
> 
> Alternatively develop the feature on a third branch, merge that branch
> into both others and delete the feature branc afterwards.

Yep, that is a great feature of git too.

> 
>> And about merging pull request, there is the direct pull, for instance:
>> git pull https://github.com/jbaruch/ant-ivy
>> <https://github.com/jbaruch/ant-ivy> patch-1
> 
>> And there is the rebase way, exemple:
> 
> The approach I've seen taken a lot on github is to have the submitter of
> the pull request rebase (and squash) the PR before you merge it.
> Squashing means you juts get a single clean commit rather than a
> sequence of refinements.

Ok.
I find it strange that there is not a simpler way to do it from the merger point of view.

Nicolas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Git workflow

Posted by Stefan Bodewig <bo...@apache.org>.
On 2015-01-07, Nicolas Lalevée wrote:

> For instance, to get commits from one branch to the other, I have seen
> two ways: via merge or via cherry-pick.
> Since our branches are meant to diverge à some point, I think using
> cherry-pick should be used, right ?

Alternatively develop the feature on a third branch, merge that branch
into both others and delete the feature branc afterwards.

> And about merging pull request, there is the direct pull, for instance:
> git pull https://github.com/jbaruch/ant-ivy
> <https://github.com/jbaruch/ant-ivy> patch-1

> And there is the rebase way, exemple:

The approach I've seen taken a lot on github is to have the submitter of
the pull request rebase (and squash) the PR before you merge it.
Squashing means you juts get a single clean commit rather than a
sequence of refinements.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org