Help

Yyou probably don't know it yet but Hibernate Core and Hibernate Validator source code is now on Git and Hibernate Search and co will likely follow very soon. There are various reasons for the move but to summarize it, life was not bad under SVN but it's really great under Git.

Getting Hibernate sources

The public reference Git repository is hosted at GitHub. We are not married to GitHub but so far, we really like the infrastructure they offer. Kudos to them! In any case moving is one clone away. That tends to keep services like that on their toes.

Hibernate Core is here while Hibernate Validator is there.

Contributing

If you want to contribute a fix or new feature, either:

  • use the GitHub fork capability: clone, work on a branch, fork the repo on GitHub (fork button), push the work there and trigger a pull request (pull request button). Also see http://help.github.com/forking and http://help.github.com/pull-requests
  • use the pure Git approach: clone, work on a branch, push to a public fork repo hosted somewhere, trigger a pull request git pull-request
  • provide a good old patch file: clone the repo, create a patch with git format-patch or diff and attach the patch file to JIRA

Our preference is GitHub over pure Git over patches:

  • GitHub lets us comment on your changes in a fine grained way
  • Git generally leads to more small commits that are easier to follow
  • a big fat patch of 100k is always depressing and can't be updated easliy

If you still want to do it the old way a provide a patch file, that's ok too.

Various tips on Git

While in no way comprehensive, here are a collection of useful tips when using Git.

Read a book on it

The time will be worth it. I particularly enjoyed Pro Git. It's an awesome book and very practical. It has a free html and epub version (buying the tree version is recommended to repay the author).

Cloning

Prefer the git protocol when cloning over http (so say the experts). At the very least that will be much faster. cloning the repo from GitHub took me less than 3 minutes.

#for people with read/write access
git clone git@github.com:hibernate/hibernate-core.git

#for people with read-only access
git clone git://github.com/hibernate/hibernate-core.git

This will create a remote link named origin. I usually tend to rename it to reflect what it really is.

git remote rename origin core-on-github

Note that you can attach more than one remote repository to your local repository

git clone git://github.com/hibernate/hibernate-core.git
git remote rename origin ref-core-github
git remote add manu-core-github git@github.com:emmanuelbernard/hibernate-core.git
git fetch manu-core-github

Pushing and pulling

To initially get a copy of a remote branch locally, do

git checkout -b 3.6 origin/3.6

When pulling a branch, it's best to keep the same name between the origin repo and your clone. Many syntax have shortcuts in this situation (are you listening Hardy? ;) ). You can then do

git push origin master

If you happen to have renamed the branch master to say local-master locally, do

git push origin local-master:master

To delete a branch on a remote repository, you push an empty one

git push origin :branch-to-remove

Branches

Always work on a topic branch and merge your work when you are done.

git checkout master
git checkout -b HHH-XXX
#hack commit hack commit

Don't forget to pull from your master and rebase this topic branch before proposing request pull.

There are many advantages to this, one of them being that you can work on many different things in parallel and sync them with the reference master easily.

Likewise if you want to share a work with somebody from the Hibernate team, push to the public repo and define the pull request of your topic branch. Make sure your topic branch is above the most recent master.

Commits

Prefer small commits, they will be more readable and will very unlikely fail on merge.

Write good comments (one short line including the issue number at stake and a summary, followed by a blank line and a more detailed explanation if needed.

HHH-XXX Fix NPE on persist

Fix stupid bug by Gavin that lead to a NPE when persisting objects with components

Merge or rebase

It's a debate, but here is my take on it.

  • Primitive 0: DO NOT rebase a branch that you have shared publicly (unless you know people won't use it or you wish them harm).
  • Primitive 1: Prefer rebase over merge assuming it does not break Primitive 0

This is particularly sensible when you trigger a pull request: rebase atop the branch you are branching of (master usually). Your work will be easier to read and integrate.

Rebase put changes from the branch you forked (say master) below the new commits you have done (say HHH-XXX) and thus keep the history linear.

git checkout HHH-XXX
git rebase master

While we are at rebasing, you can rewrite your commit history to clean comments or merge some commits together (aka squashing)

git rebase -i HEAD~6 (go back 6 commits in time)

Backporting: cherry-picking

Git made backporting fun.

Say you have done some commits on master and the sha1 of the commits are ae397d... and 87ab342...

You can apply them on an older branch very easily.

git checkout 3.5
git cherry-pick ae397d
git cherry-pick 87ab34

Bam, you're done. Now did I tell you to do small commits? That's also for the backporters.

Aliases and configuration

Once you're fed up with typing longish command lines, use aliases. I've put a copy of my ~/.gitconfig file in case people want to copy some things including aliases (see below)

~/.gitconfig
[user]
     name = Redacted
     email = redacted@redacted.com
     signingkey = id_key.pub
[core]
     editor = open -nW -a Smultron
[merge]
     tool = opendiff
[color]
     ui = auto
[color "branch"]
     current = yellow reverse
     local = yellow
     remote = green
[color "diff"]
     meta = yellow bold
     frag = magenta bold
     old = red bold
     new = green bold
[color "status"]
     added = yellow
     changed = green
     untracked = cyan
[github]
     user = redacted
     token = redacted
[alias]
     co = checkout
     undo = reset --hard
     cb = checkout -b
     br = branch
     cp = cherry-pick

Tools

If you use Mac OS X, GitX is a fantastic tool. In particular, you can very easily play with interactive staging and commit only some parts of a file in a couple of clicks. A typical use case is to separate the commit of a typo from the commit of a core feature. Some people like the built-in GitK GUI.

Command completion support via git-completion.bash is pretty good if you are command shell type person. The script is available in the Git project sources and in other places (including Fedora). Pro Git has some more information on it.

Various

You can also read this blog entry that was some more info for people moving from SVN to Git.

This entry is too long already, feel free to add your tips in the comments.

19 comments:
 
13. Oct 2010, 21:49 CET | Link
Julien Marcil

This is great news! Thank you!

ReplyQuote
 
13. Oct 2010, 22:56 CET | Link
Arbi Sookazian

Did Seam3 core move to git as well?

 
14. Oct 2010, 06:46 CET | Link
Grzegorz Grzybek

Great move! Spring has gone the same way (http://git.springsource.org).

 
14. Oct 2010, 09:02 CET | Link
Arbi Sookazian wrote on Oct 13, 2010 16:56:
Did Seam3 core move to git as well?

On it's way, should be there this week or next.

 
14. Oct 2010, 15:39 CET | Link
Eric Darchis | darchis(AT)pobox.com
From git 1.7.2, you can specify a commit range for cherrypicking. The release note says:

"git cherry-pick" learned to pick a range of commits
(e.g. "cherry-pick A..B" and "cherry-pick --stdin"), so did "git
revert"; these do not support the nicer sequencing control "rebase
[-i]" has, though.
 
16. Oct 2010, 22:45 CET | Link

This week it is! http://github.com/seam Fork away!

 
01. Nov 2010, 16:58 CET | Link

Thanks for the well-written and IMO very useful primer. Infinispan's moving to GitHub too... soon...

 
18. Jun 2014, 04:36 CET | Link

Click HELP for text formatting instruc Take apprehension of the actual from the handbag. 18-carat Gucci Replica handbags are complete with top superior materials. The alignment uses absolute covering or beastly derma to achieve the bags.We Desire in this address has accustomed you a chargeless angle acquire to be purchased to analysis the abeyant LV bag to buy.As a bulk of fact, it is absolutely accustomed for dog packs are demography pictures of them, because it is their job.You can be abiding of a cast new and 18-carat replica Hermes bag, with revenues alone afterwards abiding the archetype to bout the pre-sales account you can apprehend to access a name for data of the a lot of admired brand. And Replica watches are fabricated from just one section of leather, which agency you shouldn't see seams area the bag was stitched application several altered pieces.tions. Then edit this text and check the preview.

 
30. Jul 2014, 09:14 CET | Link

Negli ordinamento specie finali vicini Bell e Ross Bell Ross orologi sono falsi scocca in carbonio albino quadrante riserva di carica BR0197 BR7109 cinturino in silicone nero attenzione. Questo in realtà è veramente progettato per incoraggiare attrezzature militari, perché si tratta di contiene semplici istruzioni che mostrano quanta potenza della batteria è possibile prenotare orologi Replica avanzi.

 
29. Aug 2014, 06:56 CET | Link
obat jantung bengkak herbal

I have been very encouraged to locate this website. I desired to thanks with this special study. I certainly savored each and every the idea and I've you bookmarked to look at new things you publish. obat asma herbal alami obat kista herbal alami obat jantung bengkak herbal

 
19. Sep 2014, 10:49 CET | Link
replica

However, if you cannot afford to get these expensive handbags, apply for designer handbags replica adorable and affordable. The key advantage could be that the replicas are cheaper than designer chanel replica handbags without compromising quality. The replicas are created using the latest trends within the garment industry. There is no need to invest a huge amount of money, but nevertheless hold the quality and elegance together. Moreover, they are so just like the original to look at that you could not distinguish that replica on the real. Manufacturers of replica designer Chanel handbags spend considerable time and within their products to be achieve the excellent degree of the first. Replica designer handbags are worth buying rather than the originals and this allow it to become simpler for you to maintain the most up-to-date trends without having to burn a hole in your wallet.

If you've got the possibility to spend less and keep the fashion style concurrently, then you definitely should go for replica designer replica handbags. These are very well liked among women of most social classes. Therefore, replica designer handbags are worth buying, rather than the originals. Moreover, also you can get yourself replicas wholesale price, if you opt to buy online. A result of the wide range of replica bags, you possibly can surely pick one up you enjoy. Inside modern world today, a few growing number of women buying Chanel and gucci replica handbags with the latest clothes and feel the world of luxury like superstars do. A person has the legal right to pursue the wonder and fashion, irrespective you are rich or Nancy or otherwise. Since have started to the market, replica handbags popular brands have won the favor of countless people. There are lots of reasons the particular replica handbags have grown to be more popular than ever. The foremost and probably the most obvious reason is cost.

A real Gucci hand costs several hundred or maybe a lot of money, as you move the bag Gucci replica has a little under $100 replica handbags become fashionable, stylish and luxurious because the original handbags at lower prices. Also, you should purchase models of replica handbags to finish your wardrobe anytime because of price. Therefore, you can say that buying replica designer handbags is only the simplest way to uncover quality items that has a small sum. Another ingredient that these replica handbags are in reality received differs from the others styles and designs of the chanel outlet Handbags. These replica handbags are always imitated, but during the entire collection in today's authentic designer handbag group. They come in different vibrant designs, sizes, colors and fashions. Therefore, it may take several bags to fit your dress takes a different approach situation, for instance evening parties or conference formal business casual collection.

 
04. Nov 2014, 04:42 CET | Link

The public reference Git repository is hosted at GitHub. We are not married to GitHub but so far, we really like the infrastructure they offer. Kudos to them! In any case moving is one clone away. That tends to keep services like that on their toes.

 
10. Nov 2014, 14:43 CET | Link
aomine

Filmmaker Ravine Change , Datascrip said Reedlike soul sophistication and hybrid ink method printer, gives author evaluate for its users to play the situation illustrator wild and sensual , if you need the driver printer, you can check at canon printer driver They all go together with Epsons built piezo-electric subject proverbial as PrecisionCore that, per the companys spokespersons, doubles photograph grade whereas doubling if you need the driver printer, you can check at read more From the leaked it , mentioned the Samsung Collection Set 2 performed with sib SIM , 4.5 in. WVGA direct ( 480x800 pixels ) and a quad-core processor 1.2 GHz , quicker than their predecessors that the if you need the gadgets info, you can check at read more Request the exclusive angle , not notable manifestly his sincere write , yet by worldcarfans , weekday ( seventeen / 04 ) , if you need the last info about car automotive, you can check at read more Canon Pixma Mp560 Driver For Windows, Mac OS X, and Linux Download, but let me to review the printer first. The days of dropping three hundred bones on AN all-in-one printer square measure dwindling, whereas $150 devices just like the Canon Pixma MP560 square measure quickly taking their place on retail shelves. The MP560 appearance nice ANd offers helpful options like an auto-document if you need the last info update about technology, you can check at read more To any raise human publication caliber, PIXMA MG7570 adopts a 6-color mortal ink scheme with the element of achromatic ink tank to spicery up the vesture sound in B W someone printing, understandably sharing the hatched and shining if you need more info about geophysics, you can check at canon printer driver

 
11. Nov 2014, 09:03 CET | Link

Its' work thanks! Click HELP for text formatting instructions. Then edit this text and check the preview.obat asma

 
11. Nov 2014, 18:42 CET | Link
jack

is a new affiliate marketing training program dentist vero beach and platform created by Ross Carel and Austin Anthony. It is a step-by-step systems that will show you how to generate real and measurable results in affiliate marketing...

25. Nov 2014, 05:21 CET | Link

engobatan yang utama adalah dengan podophyllotoxin. Dalam kasus yang membandel, dokter merujuk Anda ke dokter spesialis penyakit kulit dan kelamin yang dapat menghilangkan kutil kelamin dengan operasi, pembekuan atau perawatan laser. Pasien transplantasi organ dan pasien imunosupresi lainnya yang memiliki kutil kelamin dan kutil lainnya harus menghubungi dokter, karena kutil pada kelompok pasien ini harus ditangani secara agresif untuk mencegah menjadi keganasan (kanker).

harga obat kutil kelamin cara mengobati kutil kelamin obat kutil kelamin alami cara mengobati kutil kelamin secara alami obat kutil kelamin manjur cara mengobati kutil kelamin secara herbal obat kutil kelamin ampuh cara mengobati kutil kelamin tanpa operasi obat kutil kelamin wanita cara mengobati kutil kelamin pada ibu hamil obat kutil kelamin tanpa operasi cara mengobati kutil kelamin bagaimana ya obat kutil kelamin apa ya bagaimana cara mengobati kutil kelamin obat kutil kelamin ibu hamil cara mengobati kutil kelamin dengan cepat obat kutil kelamin terbaik cara mengobati kutil kelamin pada wanita obat kutil kelamin yang paling manjur cara mengobati kutil kelamin pada pria

 
27. Nov 2014, 08:04 CET | Link
 
27. Nov 2014, 08:14 CET | Link
ramlan

kartu undangan pernikahanuntuk pemesanan kartu undangan pernikahan bentuk apapun silakan kunjungi website kami

Post Comment