3 Replies Latest reply on Jan 26, 2011 7:25 AM by tfennelly

    Git Pushes

    kcbabo

      I wanted to review / get consensus on a few items related to pushing in pull requests.

       

      1) Before you process (i.e. push) a pull request, make sure that the path you are using is up-to-date with upstream.

       

      2) Look at the output of the merge command when you are processing the pull request.  If you see merge messages, take a closer look at what happened.  Run 'git status' to see if the number of commits in the pull request (preferably 1) match the number of commits you are in front of upstream.  If these don't match, then there's a problem (e.g. there was a merge, possibly due to out-of-sync paths).

       

      3) Process pull requests in order.  As our development continues to ramp up, the chances of getting multiple, overlapping pull requests is going to go up.  Push them in order.  It's easier to stay coordinated that way.  Which brings me to (4) ....

       

      4) Some people announce on IRC when processing a pull request, others comment on the JIRA, and others just do it without saying anything.  Not sure why I didn't think of this before, but we should just be commenting on the pull request itself.  There's no chance of missing the comment in that case; if someone has already started to process the pull request you will see the comment as soon as you go to grab it.

       

      Let me know if there's a problem with the above.  Silence = acceptance. ;-)

        • 1. Re: Git Pushes
          tfennelly

          Hey Keith.... I think this might have been prompted by a pull request I did that resulted in a merge commit.  Sorry about that... my bad.  This was strange however.  I did a pull on origin master for my upstream clone and the output was tat all was up to date...

           

          scrat:upstream tfennelly$ git pull origin master

          From github.com:jboss-switchyard/core

          * branch            master     -> FETCH_HEAD

          Already up-to-date.

          scrat:upstream tfennelly$ git checkout -b kcbabo-SWITCHYARD-57 master

           

          And then the merge....

           

           

          scrat:upstream tfennelly$ git checkout master

          Switched to branch 'master'

          Your branch is ahead of 'origin/master' by 4 commits.

          scrat:upstream tfennelly$ git merge kcbabo-SWITCHYARD-57

          Updating 881ac12..5bff680

          Fast-forward

          .../api/src/main/java/org/switchyard/Exchange.java |    9 +---

          core/api/src/main/java/org/switchyard/Service.java |   11 +++-

          .../main/java/org/switchyard/ServiceDomain.java    |   25 ++++++++++-

          .../java/org/switchyard/spi/ServiceRegistry.java   |    5 +-

          .../switchyard/internal/DefaultHandlerChain.java   |    2 +-

          .../internal/DefaultServiceRegistry.java           |    8 ++-

          .../java/org/switchyard/internal/DomainImpl.java   |   30 +++++++++++--

          .../java/org/switchyard/internal/ExchangeImpl.java |   31 ++++++-------

          .../org/switchyard/internal/ServiceDomains.java    |    2 +-

          .../switchyard/internal/ServiceRegistration.java   |    9 ++++

          .../internal/handlers/AddressingHandler.java       |   26 +----------

          .../internal/DefaultServiceRegistryTest.java       |    2 +-

          .../org/switchyard/internal/DomainImplTest.java    |   46 ++++++++++++++++++--

          .../org/switchyard/internal/ExchangeImplTest.java  |   10 ++--

          .../test/java/org/switchyard/tests/InOnlyTest.java |    5 +-

          .../test/java/org/switchyard/tests/InOutTest.java  |    9 ++--

          .../org/switchyard/tests/TransformationTest.java   |   13 +++---

          .../switchyard/internal/MockServiceRegistry.java   |    7 ++-

          18 files changed, 164 insertions(+), 86 deletions(-)

          scrat:upstream tfennelly$ git push origin master

          Counting objects: 4, done.

          Delta compression using up to 2 threads.

          Compressing objects: 100% (2/2), done.

          Writing objects: 100% (2/2), 331 bytes, done.

          Total 2 (delta 1), reused 0 (delta 0)

          To git@github.com:jboss-switchyard/core.git

             881ac12..5bff680  master -> master

           

           

          Yet it still resulted in a merge commit, which was strange.

           

          Not making excuses though... I even have a git alias set up to graph the history, so it's easy for me to see how many parent a commit has before I push... so I should have spotted that.

           

          Keith Babo wrote:

           

          Not sure why I didn't think of this before, but we should just be commenting on the pull request itself.

           

          You're too funny.  Check your IRC history from a few days back

          • 2. Git Pushes
            kcbabo

            Tom Fennelly wrote:

             

            Hey Keith.... I think this might have been prompted by a pull request I did that resulted in a merge commit.  Sorry about that... my bad.  This was strange however.  I did a pull on origin master for my upstream clone and the output was tat all was up to date...

             

            Actually, the same thing happened on a pull request that I handled a couple days back, so it's definitely not just you.  :-) 

             

            I'm not sure what the problem was with SWITCHYARD-57.  It very well could have been a problem with the branch I used to submit the pull request.  I'm pretty sure it was up to date, but maybe not.  In any case, the reason I brought this up was to remind us all that a merge when handling a pull request is an event that requires some attention.  If we see a merge, we should work the the person submitting the pull request to sort it out.

             

            Keith Babo wrote:

             

            Not sure why I didn't think of this before, but we should just be commenting on the pull request itself.

             

            You're too funny.  Check your IRC history from a few days back

             

            Oh boy.  Sorry about that.  For some reason, I thought you were suggesting to add the comment to the JIRA instead of the pull request.  I didn't really like the idea of going into JIRA to indicate a pull was being processed, then go to github, then back to JIRA to mark it as resolved.  Looking back, it seems like you were saying to mark it in GitHub, which obviously makes sense to me. :-)

             

            Perhaps another thing we should formalize is if you are submitting a pull request that corresponds to a JIRA (which is usually the case), put a link to the JIRA in the pull request.

            • 3. Re: Git Pushes
              tfennelly

              The thing I didn't do (and which I should have) was to make sure I didn't create a merge commit (a commit with 1+ parent commits) before pushing it.

               

              This is easy to do.  I would have seen the following...

               

              scrat:tfennelly tfennelly$ git lol
              *   5bff680 Merge branch 'SWITCHYARD-57' of https://github.com/kcbabo/core into kcbabo-SWITCHYARD-57
              |\  
              | * 5db4349 SWITCHYARD-57 Service and ServiceInterface improvements
              * | 881ac12 SWITCHYARD-55 Sample service classes generated by application archetype have bad package name
              * | fee743a SWITCHYARD-52 Update name and artifactId in bean component pom
              |/  
              * 1a28d67 SWITCHYARD-51 change core pom to remove dashboard plugin, allow findbugs and checktyle to run independently
              * 2a1d30b SWITCHYARD-27 Changed scope of test-util to test.    Added the dependency to registry with test scope because of the change.
              

               

              So pushing there results in a merge commit (5bff680) with 2 parent commits (5db4349 and 881ac12).  I'm not sure why the merge was the case, but it should have been easy to sort out.