Login | Register
My pages Projects Community openCollabNet

argouml
Wiki: Diff for "Using GIT and Gerrit"

Edit this page | Links to this page | Page information | Attachments | Refresh page

 

Differences between revisions 1 and 13 (spanning 13 versions)

Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
It is also possible to download using GIT and Commit to a Gerrit server. This has the following benefits:
 * Anyone can check-in to the Gerrit server. No role in the project is needed.
 * The Continuous Integration server tests the commit before it is approved for commit.
 * The Gerrit server can be used to discuss the commit before it is approved.
It is now also possible to contribute to the argouml projects through Gerrit.
This also means that you will be using git instead of subversion so
it is also an option for those that prefer git.
This approach has some [:/Advocacy:pros and cons].
Line 6: Line 6:
It has the following draw-backs:
 * The testmodels are not available in the same place as they are when checking out with subversion. If building with maven, this is solved.
 * You tigris id will not be the one doing the commit in subversion.
Here is a short introduction on how to do it:
 1. Register on the [https://argouml-jenkins1.no-ip.biz:8443/ Gerrit server] and create your Gerrit user, set-up your email, register your public ssh-key with this user. (One time only.)
 1. Clone the git repository '''git clone ssh://''your_gerrit_user''@argouml-jenkins1.no-ip.biz:29418/''project'' ''project''''', and '''cd ''project'''''. (One time per machine you are working on. This takes more than 3 minutes and uses 320Meg for the main '''argouml''' project.). For more work using the same machine, you can pull down updates using '''git pull''' and '''git rebase origin/trunk'''.
 1. Create a local git branch for your work and switch to it '''git branch ''work''''', '''git checkout ''work'''''.
 1. Do your work.
 1. Run the tests ('''mvn test''', '''mvn exec:java''', ...)
 1. Check into your git repository using a single commit '''git add ...''', '''git commit -m'Message' ''' if needed followed by a sequence of commit amends '''git commit --amend'''.
 1. Push your Patch Set to the Gerrit server for review '''git push origin HEAD:refs/for/trunk'''. This will fail and suggest a Change-Id if you havn't provided on.
 1. After your commit, you will get mails from the Gerrit server with information on the Continuous Integration job and other review comments. Monitor the Gerrit server to take part in any discussion of your changes.
 1. If you need to push an updated Patch Set to replace the previous Patch Set commit using '''git commit --amend''' and push again '''git push origin HEAD:refs/for/trunk'''. This relies on the Change-Id in the commit message to identify the change. The Gerrit server will pick up on the Change-Id and treat this as a replacement Patch Set.
 1. When a Gerrit Approver has approved your change, it is automatically checked into the subversion repository.
Line 10: Line 18:
This is how it is used:
 1. Register on the [https://argouml-jenkins1.dyndns.org:8443/ Gerrit server] and create your Gerrit user, register your public ssh-key with this user. (One time only.)
 1. Clone the git repository '''git clone ssh://''your_gerrit_user''@argouml-jenkins1.dyndns.org:29418/''project_to_work_on'' ''project_to_work_on''''', and '''cd ''project_you_work_on'''''. (One time per machine you are working on. This takes more than 3 minutes and uses 320Meg for the main '''argouml''' project.). For more work using the same machine, you can pull down updates using '''git pull''' and '''git rebase'''.
 1. Create a local git branch for your work and switch to it '''git branch ''my_work'''''.
 1. Do your work.
 1. Run the tests ('''mvn test''', ...)
 1. Check into your git repository using a single commit '''git add ...''', '''git commit -m'Message' ''' or a sequence of commit amends '''git commit --amend'''.
 1. Push your commit to the Gerrit server for review '''git push origin HEAD:refs/for/trunk'''. You will get mails from the Gerrit server with information on the Continuous Integration job and other review comments. Monitor the Gerrit server to take part in any discussion of your changes.
 1. When a Gerrit approver has approved your change, it is automatically checked into the subversion repository.

== Syntax of commit message ==
Short sentence[[BR]]
<empty line>[[BR]]
Full explanation[[BR]]
[[BR]]
Contributed-by: [[BR]]
Change-Id: [[BR]]
[Submitted-by:] [[BR]]

It is now also possible to contribute to the argouml projects through Gerrit. This also means that you will be using git instead of subversion so it is also an option for those that prefer git. This approach has some pros and cons.

Here is a short introduction on how to do it:

  1. Register on the Gerrit server and create your Gerrit user, set-up your email, register your public ssh-key with this user. (One time only.)

  2. Clone the git repository git clone ssh://your_gerrit_user@argouml-jenkins1.no-ip.biz:29418/project project, and cd project. (One time per machine you are working on. This takes more than 3 minutes and uses 320Meg for the main argouml project.). For more work using the same machine, you can pull down updates using git pull and git rebase origin/trunk.

  3. Create a local git branch for your work and switch to it git branch work, git checkout work.

  4. Do your work.
  5. Run the tests (mvn test, mvn exec:java, ...)

  6. Check into your git repository using a single commit git add ..., git commit -m'Message' if needed followed by a sequence of commit amends git commit --amend.

  7. Push your Patch Set to the Gerrit server for review git push origin HEAD:refs/for/trunk. This will fail and suggest a Change-Id if you havn't provided on.

  8. After your commit, you will get mails from the Gerrit server with information on the Continuous Integration job and other review comments. Monitor the Gerrit server to take part in any discussion of your changes.
  9. If you need to push an updated Patch Set to replace the previous Patch Set commit using git commit --amend and push again git push origin HEAD:refs/for/trunk. This relies on the Change-Id in the commit message to identify the change. The Gerrit server will pick up on the Change-Id and treat this as a replacement Patch Set.

  10. When a Gerrit Approver has approved your change, it is automatically checked into the subversion repository.

Syntax of commit message

Short sentence
<empty line>
Full explanation

Contributed-by:
Change-Id:
[Submitted-by:]

Using GIT and Gerrit (last edited 2013-10-18 22:03:18 -0700 by linus)