You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geode.apache.org by Kirk Lund <kl...@pivotal.io> on 2015/08/20 01:18:54 UTC

Pull requests, wiki page and multiple git commits

I just merged PR#15 in to develop. I tried following the instructions on
https://cwiki.apache.org/confluence/display/GEODE/Code+contributions but I
couldn't get things to really work the way I wanted or the way the page
seemed to describe it.

I wanted all three of the following commits to be one commit on today's
date with a single unified commit message including "GEODE-213". The pulled
commit went in for Aug 12 despite attempting to use --rebase instead of
--squash.

If anyone knows git well, please update that wiki page so that we can
cleanly handle pull requests.

commit bbc2a5fa5f0bbcd00a8ab64451a2528a22d88bc0
Merge: 9efe74e 581702a
Author: Kirk Lund <kl...@pivotal.io>
Date:   Wed Aug 19 16:09:21 2015 -0700

    Merge branch 'feature/GEODE-213' into develop

commit 581702ac1d2a9debe8619680d09fa868b9ca8b05
Author: Kirk Lund <kl...@pivotal.io>
Date:   Wed Aug 19 16:01:26 2015 -0700

    GEODE-213: New unit test that confirms bug

commit 65e969439e3c03f5557b2e1adc609c97544ecb2b
Author: Vito Gavrilov <vg...@pivotal.io>
Date:   Wed Aug 12 13:13:55 2015 -0700

    Fix JMX Http manager incorrectly treating 'start gateway-sender'
endpoint as 'start gateway-receiver'

<kl...@klund-e6420>/c/dev/geode_CLEAN [590]$ git --version
git version 2.4.5

<kl...@klund-e6420>/c/dev/geode_CLEAN [594]$ git-flow version
1.8.0 (AVH Edition)

Re: Pull requests, wiki page and multiple git commits

Posted by Dan Smith <ds...@pivotal.io>.
After some investigation, it looks like what happened to Kirk was a lot
more complicated than I realized. If you do a command like this, but you
have pull.rebase set to true in your git config, you will rebasing your
local develop on top of the pull request, which is probably not what you
want.

git pull --squash github pull/15/head

I've updated the instructions on the wiki page.

On Wed, Aug 19, 2015 at 5:13 PM, Dan Smith <ds...@pivotal.io> wrote:

> git rebase -i will work. git rebase would change your dates, but doesn't
> squash your commits together.
>
> Regarding your question about why it's using the Aug 12 date, its because
> merges *never* change anything about the original commits. That includes
> the author, date, etc. What you did was simply merge in the commit from
> vito, so it naturally was not changed. When you do a rebase it creates a
> new commit.
>
> Maybe this will make things more clear -
> https://www.atlassian.com/git/tutorials/merging-vs-rebasing
>
> -Dan
>
>
>
> On Wed, Aug 19, 2015 at 5:02 PM, Kirk Lund <ki...@gmail.com> wrote:
>
>> I tried a rebase but couldn't get the older commit to combine with the
>> newer commit. Perhaps because there are intervening commits or maybe
>> because it's from github.
>>
>> If I pull a remote commit today and commit it, why does the log show it as
>> being committed on Aug 12? Yes I know that's when the PR was created but I
>> can't imagine that ever being desirable & yet that's the default behavior.
>>
>> If I do a git flow finish & then rebase before pushing, will squashing it
>> in with another commit from today cause that Aug 12 commit to jump forward
>> to today's date? There are other intervening commits that were previously
>> pushed to develop & I can't seem to move that old PR forward to be the
>> latest commit. I'm referring to the command involved in "git pull github
>> ..." -- something isn't right in that part of the wiki page & the docs for
>> git pull weren't much better.
>>
>> I think we need some steps written up showing the proper best-practice for
>> the rest of us to follow -- esp if we want to keep our git log clean. It's
>> pretty weird to commit something today but have it inserted a week in the
>> past in our git revisions.
>>
>> On Wednesday, August 19, 2015, Dan Smith <ds...@pivotal.io> wrote:
>>
>> > You can always do a git rebase -i before you push if you want to fix up
>> the
>> > history.
>> >
>> > On Wed, Aug 19, 2015 at 4:18 PM, Kirk Lund <klund@pivotal.io
>> > <javascript:;>> wrote:
>> >
>> > > I just merged PR#15 in to develop. I tried following the instructions
>> on
>> > > https://cwiki.apache.org/confluence/display/GEODE/Code+contributions
>> > but I
>> > > couldn't get things to really work the way I wanted or the way the
>> page
>> > > seemed to describe it.
>> > >
>> > > I wanted all three of the following commits to be one commit on
>> today's
>> > > date with a single unified commit message including "GEODE-213". The
>> > pulled
>> > > commit went in for Aug 12 despite attempting to use --rebase instead
>> of
>> > > --squash.
>> > >
>> > > If anyone knows git well, please update that wiki page so that we can
>> > > cleanly handle pull requests.
>> > >
>> > > commit bbc2a5fa5f0bbcd00a8ab64451a2528a22d88bc0
>> > > Merge: 9efe74e 581702a
>> > > Author: Kirk Lund <klund@pivotal.io <javascript:;>>
>> > > Date:   Wed Aug 19 16:09:21 2015 -0700
>> > >
>> > >     Merge branch 'feature/GEODE-213' into develop
>> > >
>> > > commit 581702ac1d2a9debe8619680d09fa868b9ca8b05
>> > > Author: Kirk Lund <klund@pivotal.io <javascript:;>>
>> > > Date:   Wed Aug 19 16:01:26 2015 -0700
>> > >
>> > >     GEODE-213: New unit test that confirms bug
>> > >
>> > > commit 65e969439e3c03f5557b2e1adc609c97544ecb2b
>> > > Author: Vito Gavrilov <vgavrilov@pivotal.io <javascript:;>>
>> > > Date:   Wed Aug 12 13:13:55 2015 -0700
>> > >
>> > >     Fix JMX Http manager incorrectly treating 'start gateway-sender'
>> > > endpoint as 'start gateway-receiver'
>> > >
>> > > <kl...@klund-e6420>/c/dev/geode_CLEAN [590]$ git --version
>> > > git version 2.4.5
>> > >
>> > > <kl...@klund-e6420>/c/dev/geode_CLEAN [594]$ git-flow version
>> > > 1.8.0 (AVH Edition)
>> > >
>> >
>>
>
>

Re: Pull requests, wiki page and multiple git commits

Posted by Dan Smith <ds...@pivotal.io>.
git rebase -i will work. git rebase would change your dates, but doesn't
squash your commits together.

Regarding your question about why it's using the Aug 12 date, its because
merges *never* change anything about the original commits. That includes
the author, date, etc. What you did was simply merge in the commit from
vito, so it naturally was not changed. When you do a rebase it creates a
new commit.

Maybe this will make things more clear -
https://www.atlassian.com/git/tutorials/merging-vs-rebasing

-Dan



On Wed, Aug 19, 2015 at 5:02 PM, Kirk Lund <ki...@gmail.com> wrote:

> I tried a rebase but couldn't get the older commit to combine with the
> newer commit. Perhaps because there are intervening commits or maybe
> because it's from github.
>
> If I pull a remote commit today and commit it, why does the log show it as
> being committed on Aug 12? Yes I know that's when the PR was created but I
> can't imagine that ever being desirable & yet that's the default behavior.
>
> If I do a git flow finish & then rebase before pushing, will squashing it
> in with another commit from today cause that Aug 12 commit to jump forward
> to today's date? There are other intervening commits that were previously
> pushed to develop & I can't seem to move that old PR forward to be the
> latest commit. I'm referring to the command involved in "git pull github
> ..." -- something isn't right in that part of the wiki page & the docs for
> git pull weren't much better.
>
> I think we need some steps written up showing the proper best-practice for
> the rest of us to follow -- esp if we want to keep our git log clean. It's
> pretty weird to commit something today but have it inserted a week in the
> past in our git revisions.
>
> On Wednesday, August 19, 2015, Dan Smith <ds...@pivotal.io> wrote:
>
> > You can always do a git rebase -i before you push if you want to fix up
> the
> > history.
> >
> > On Wed, Aug 19, 2015 at 4:18 PM, Kirk Lund <klund@pivotal.io
> > <javascript:;>> wrote:
> >
> > > I just merged PR#15 in to develop. I tried following the instructions
> on
> > > https://cwiki.apache.org/confluence/display/GEODE/Code+contributions
> > but I
> > > couldn't get things to really work the way I wanted or the way the page
> > > seemed to describe it.
> > >
> > > I wanted all three of the following commits to be one commit on today's
> > > date with a single unified commit message including "GEODE-213". The
> > pulled
> > > commit went in for Aug 12 despite attempting to use --rebase instead of
> > > --squash.
> > >
> > > If anyone knows git well, please update that wiki page so that we can
> > > cleanly handle pull requests.
> > >
> > > commit bbc2a5fa5f0bbcd00a8ab64451a2528a22d88bc0
> > > Merge: 9efe74e 581702a
> > > Author: Kirk Lund <klund@pivotal.io <javascript:;>>
> > > Date:   Wed Aug 19 16:09:21 2015 -0700
> > >
> > >     Merge branch 'feature/GEODE-213' into develop
> > >
> > > commit 581702ac1d2a9debe8619680d09fa868b9ca8b05
> > > Author: Kirk Lund <klund@pivotal.io <javascript:;>>
> > > Date:   Wed Aug 19 16:01:26 2015 -0700
> > >
> > >     GEODE-213: New unit test that confirms bug
> > >
> > > commit 65e969439e3c03f5557b2e1adc609c97544ecb2b
> > > Author: Vito Gavrilov <vgavrilov@pivotal.io <javascript:;>>
> > > Date:   Wed Aug 12 13:13:55 2015 -0700
> > >
> > >     Fix JMX Http manager incorrectly treating 'start gateway-sender'
> > > endpoint as 'start gateway-receiver'
> > >
> > > <kl...@klund-e6420>/c/dev/geode_CLEAN [590]$ git --version
> > > git version 2.4.5
> > >
> > > <kl...@klund-e6420>/c/dev/geode_CLEAN [594]$ git-flow version
> > > 1.8.0 (AVH Edition)
> > >
> >
>

Re: Pull requests, wiki page and multiple git commits

Posted by Kirk Lund <ki...@gmail.com>.
I tried a rebase but couldn't get the older commit to combine with the
newer commit. Perhaps because there are intervening commits or maybe
because it's from github.

If I pull a remote commit today and commit it, why does the log show it as
being committed on Aug 12? Yes I know that's when the PR was created but I
can't imagine that ever being desirable & yet that's the default behavior.

If I do a git flow finish & then rebase before pushing, will squashing it
in with another commit from today cause that Aug 12 commit to jump forward
to today's date? There are other intervening commits that were previously
pushed to develop & I can't seem to move that old PR forward to be the
latest commit. I'm referring to the command involved in "git pull github
..." -- something isn't right in that part of the wiki page & the docs for
git pull weren't much better.

I think we need some steps written up showing the proper best-practice for
the rest of us to follow -- esp if we want to keep our git log clean. It's
pretty weird to commit something today but have it inserted a week in the
past in our git revisions.

On Wednesday, August 19, 2015, Dan Smith <ds...@pivotal.io> wrote:

> You can always do a git rebase -i before you push if you want to fix up the
> history.
>
> On Wed, Aug 19, 2015 at 4:18 PM, Kirk Lund <klund@pivotal.io
> <javascript:;>> wrote:
>
> > I just merged PR#15 in to develop. I tried following the instructions on
> > https://cwiki.apache.org/confluence/display/GEODE/Code+contributions
> but I
> > couldn't get things to really work the way I wanted or the way the page
> > seemed to describe it.
> >
> > I wanted all three of the following commits to be one commit on today's
> > date with a single unified commit message including "GEODE-213". The
> pulled
> > commit went in for Aug 12 despite attempting to use --rebase instead of
> > --squash.
> >
> > If anyone knows git well, please update that wiki page so that we can
> > cleanly handle pull requests.
> >
> > commit bbc2a5fa5f0bbcd00a8ab64451a2528a22d88bc0
> > Merge: 9efe74e 581702a
> > Author: Kirk Lund <klund@pivotal.io <javascript:;>>
> > Date:   Wed Aug 19 16:09:21 2015 -0700
> >
> >     Merge branch 'feature/GEODE-213' into develop
> >
> > commit 581702ac1d2a9debe8619680d09fa868b9ca8b05
> > Author: Kirk Lund <klund@pivotal.io <javascript:;>>
> > Date:   Wed Aug 19 16:01:26 2015 -0700
> >
> >     GEODE-213: New unit test that confirms bug
> >
> > commit 65e969439e3c03f5557b2e1adc609c97544ecb2b
> > Author: Vito Gavrilov <vgavrilov@pivotal.io <javascript:;>>
> > Date:   Wed Aug 12 13:13:55 2015 -0700
> >
> >     Fix JMX Http manager incorrectly treating 'start gateway-sender'
> > endpoint as 'start gateway-receiver'
> >
> > <kl...@klund-e6420>/c/dev/geode_CLEAN [590]$ git --version
> > git version 2.4.5
> >
> > <kl...@klund-e6420>/c/dev/geode_CLEAN [594]$ git-flow version
> > 1.8.0 (AVH Edition)
> >
>

Re: Pull requests, wiki page and multiple git commits

Posted by Dan Smith <ds...@pivotal.io>.
You can always do a git rebase -i before you push if you want to fix up the
history.

On Wed, Aug 19, 2015 at 4:18 PM, Kirk Lund <kl...@pivotal.io> wrote:

> I just merged PR#15 in to develop. I tried following the instructions on
> https://cwiki.apache.org/confluence/display/GEODE/Code+contributions but I
> couldn't get things to really work the way I wanted or the way the page
> seemed to describe it.
>
> I wanted all three of the following commits to be one commit on today's
> date with a single unified commit message including "GEODE-213". The pulled
> commit went in for Aug 12 despite attempting to use --rebase instead of
> --squash.
>
> If anyone knows git well, please update that wiki page so that we can
> cleanly handle pull requests.
>
> commit bbc2a5fa5f0bbcd00a8ab64451a2528a22d88bc0
> Merge: 9efe74e 581702a
> Author: Kirk Lund <kl...@pivotal.io>
> Date:   Wed Aug 19 16:09:21 2015 -0700
>
>     Merge branch 'feature/GEODE-213' into develop
>
> commit 581702ac1d2a9debe8619680d09fa868b9ca8b05
> Author: Kirk Lund <kl...@pivotal.io>
> Date:   Wed Aug 19 16:01:26 2015 -0700
>
>     GEODE-213: New unit test that confirms bug
>
> commit 65e969439e3c03f5557b2e1adc609c97544ecb2b
> Author: Vito Gavrilov <vg...@pivotal.io>
> Date:   Wed Aug 12 13:13:55 2015 -0700
>
>     Fix JMX Http manager incorrectly treating 'start gateway-sender'
> endpoint as 'start gateway-receiver'
>
> <kl...@klund-e6420>/c/dev/geode_CLEAN [590]$ git --version
> git version 2.4.5
>
> <kl...@klund-e6420>/c/dev/geode_CLEAN [594]$ git-flow version
> 1.8.0 (AVH Edition)
>