[[!toc levels=3]]
https://github.com/IQSS/dvn/branches
Please note that with the move to git, we are adopting the branching model described at http://nvie.com/posts/a-successful-git-branching-model/
In this branching model there are two persistent branches:
- develop: where all new commits go
- master: where code gets merged and tagged as a release
That is to say, please make your commits on the develop branch, not the master branch.
"The essence of a feature branch is that it exists as long as the feature is in development, but will eventually be merged back into develop (to definitely add the new feature to the upcoming release) or discarded (in case of a disappointing experiment)." -- http://nvie.com/posts/a-successful-git-branching-model/
First, we create the branch and check it out:
murphy:dvn pdurbin$ git branch
2656-solr
* develop
murphy:dvn pdurbin$ git branch 2656-lucene
murphy:dvn pdurbin$
murphy:dvn pdurbin$ git branch
2656-lucene
2656-solr
* develop
murphy:dvn pdurbin$ git checkout 2656-lucene
Switched to branch '2656-lucene'
murphy:dvn pdurbin$
murphy:dvn pdurbin$ git status
# On branch 2656-lucene
nothing to commit (working directory clean)
murphy:dvn pdurbin$
Then, we make a change and a commit, and push it to https://github.com/iqss/dvn/tree/2656-lucene (creating a new remote branch):
murphy:dvn pdurbin$ vim src/DVN-EJB/src/java/edu/harvard/iq/dvn/core/index/Indexer.java
murphy:dvn pdurbin$
murphy:dvn pdurbin$ git commit -m 'start lucene faceting branch' src/DVN-EJB/src/java/edu/harvard/iq/dvn/core/index/Indexer.java
[2656-lucene 3b82f88] start lucene faceting branch
1 file changed, 73 insertions(+), 2 deletions(-)
murphy:dvn pdurbin$
murphy:dvn pdurbin$ git push origin 2656-lucene
Counting objects: 25, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (13/13), 2.23 KiB, done.
Total 13 (delta 6), reused 0 (delta 0)
To git@github.com:IQSS/dvn.git
* [new branch] 2656-lucene -> 2656-lucene
murphy:dvn pdurbin$
As we work on the feature branch, we merge the latest changes from "develop". We want to resolve conflicts in the feature branch itself so that the feature branch will merge cleanly into "develop" when we're ready. In the example below, we use git mergetool and opendiff to resolve conflicts and save the merge. Then we push the newly-merged 2656-lucene feature branch to GitHub.
murphy:dvn pdurbin$ git branch
* 2656-lucene
2656-solr
develop
murphy:dvn pdurbin$ git checkout develop
murphy:dvn pdurbin$ git branch
2656-lucene
2656-solr
* develop
murphy:dvn pdurbin$ git pull
remote: Counting objects: 206, done.
remote: Compressing objects: 100% (43/43), done.
remote: Total 120 (delta 70), reused 96 (delta 46)
Receiving objects: 100% (120/120), 17.65 KiB, done.
Resolving deltas: 100% (70/70), completed with 40 local objects.
From github.com:IQSS/dvn
8fd223d..9967413 develop -> origin/develop
Updating 8fd223d..9967413
Fast-forward
.../admin/EditNetworkPrivilegesServiceBean.java | 5 +-
(snip)
src/DVN-web/web/study/StudyFilesFragment.xhtml | 2 +-
12 files changed, 203 insertions(+), 118 deletions(-)
murphy:dvn pdurbin$ murphy:dvn pdurbin$ git pull
remote: Counting objects: 206, done.
remote: Compressing objects: 100% (43/43), done.
remote: Total 120 (delta 70), reused 96 (delta 46)
Receiving objects: 100% (120/120), 17.65 KiB, done.
Resolving deltas: 100% (70/70), completed with 40 local objects.
From github.com:IQSS/dvn
8fd223d..9967413 develop -> origin/develop
Updating 8fd223d..9967413
Fast-forward
.../admin/EditNetworkPrivilegesServiceBean.java | 5 +-
(snip)
.../harvard/iq/dvn/core/web/study/StudyUI.java | 2 +-
src/DVN-web/web/HomePage.xhtml | 5 +-
murphy:dvn pdurbin$
murphy:dvn pdurbin$ git checkout 2656-lucene
Switched to branch '2656-lucene'
murphy:dvn pdurbin$
murphy:dvn pdurbin$
murphy:dvn pdurbin$ git merge develop
Auto-merging src/DVN-web/web/BasicSearchFragment.xhtml
CONFLICT (content): Merge conflict in src/DVN-web/web/BasicSearchFragment.xhtml
Auto-merging src/DVN-web/src/edu/harvard/iq/dvn/core/web/BasicSearchFragment.java
Auto-merging src/DVN-EJB/src/java/edu/harvard/iq/dvn/core/index/Indexer.java
Automatic merge failed; fix conflicts and then commit the result.
murphy:dvn pdurbin$
murphy:dvn pdurbin$ git status
# On branch 2656-lucene
# Changes to be committed:
#
# modified: src/DVN-EJB/src/java/edu/harvard/iq/dvn/core/admin/EditNetworkPrivilegesServiceBean.java
(snip)
# new file: src/DVN-web/web/admin/ChooseDataverseForCreateStudy.xhtml
# modified: src/DVN-web/web/study/StudyFilesFragment.xhtml
#
# Unmerged paths:
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
# both modified: src/DVN-web/web/BasicSearchFragment.xhtml
#
murphy:dvn pdurbin$ git mergetool
merge tool candidates: opendiff kdiff3 tkdiff xxdiff meld tortoisemerge gvimdiff diffuse ecmerge p4merge araxis bc3 emerge vimdiff
Merging:
src/DVN-web/web/BasicSearchFragment.xhtml
Normal merge conflict for 'src/DVN-web/web/BasicSearchFragment.xhtml':
{local}: modified file
{remote}: modified file
Hit return to start merge resolution tool (opendiff):
murphy:dvn pdurbin$
murphy:dvn pdurbin$ git add .
murphy:dvn pdurbin$
murphy:dvn pdurbin$ git commit -m "Merge branch 'develop' into 2656-lucene"
[2656-lucene 519cd8c] Merge branch 'develop' into 2656-lucene
murphy:dvn pdurbin$
murphy:dvn pdurbin$ git push origin 2656-lucene
(snip)
murphy:dvn pdurbin$
When we are ready to merge the feature branch back into the develop branch, we can do so.
Here's an example of merging the 2656-lucene branch back into develop:
murphy:dvn pdurbin$ git checkout 2656-lucene
Switched to branch '2656-lucene'
murphy:dvn pdurbin$ git pull
Already up-to-date.
murphy:dvn pdurbin$ git checkout develop
Switched to branch 'develop'
murphy:dvn pdurbin$ git pull
Already up-to-date.
murphy:dvn pdurbin$ git merge 2656-lucene
Removing lib/dvn-lib-EJB/lucene-core-3.0.0.jar
Merge made by the 'recursive' strategy.
lib/dvn-lib-EJB/lucene-core-3.0.0.jar | Bin 1021623 -> 0 bytes
lib/dvn-lib-EJB/lucene-core-3.5.0.jar | Bin 0 -> 1466301 bytes
lib/dvn-lib-EJB/lucene-facet-3.5.0.jar | Bin 0 -> 293582 bytes
src/DVN-EJB/src/java/edu/harvard/iq/dvn/core/index/DvnQuery.java | 160 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/DVN-EJB/src/java/edu/harvard/iq/dvn/core/index/IndexServiceBean.java | 56 ++++++++++++++++++++
src/DVN-EJB/src/java/edu/harvard/iq/dvn/core/index/IndexServiceLocal.java | 16 +++++-
src/DVN-EJB/src/java/edu/harvard/iq/dvn/core/index/Indexer.java | 432 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
src/DVN-EJB/src/java/edu/harvard/iq/dvn/core/index/ResultsWithFacets.java | 71 +++++++++++++++++++++++++
src/DVN-web/src/SearchFieldBundle.properties | 4 +-
src/DVN-web/src/edu/harvard/iq/dvn/core/web/AdvSearchPage.java | 86 +++++++++++++++++++++++++++++++
src/DVN-web/src/edu/harvard/iq/dvn/core/web/BasicSearchFragment.java | 102 +++++++++++++++++++++++++++++++++++-
src/DVN-web/src/edu/harvard/iq/dvn/core/web/StudyListing.java | 11 ++++
src/DVN-web/src/edu/harvard/iq/dvn/core/web/StudyListingPage.java | 428 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
src/DVN-web/src/edu/harvard/iq/dvn/core/web/study/FacetResultUI.java | 42 +++++++++++++++
src/DVN-web/src/edu/harvard/iq/dvn/core/web/study/FacetUI.java | 62 ++++++++++++++++++++++
src/DVN-web/web/AdvSearchPage.xhtml | 3 +-
src/DVN-web/web/BasicSearchFragment.xhtml | 9 ++--
src/DVN-web/web/StudyListingPage.xhtml | 43 +++++++++++-----
18 files changed, 1500 insertions(+), 25 deletions(-)
delete mode 100644 lib/dvn-lib-EJB/lucene-core-3.0.0.jar
create mode 100644 lib/dvn-lib-EJB/lucene-core-3.5.0.jar
create mode 100644 lib/dvn-lib-EJB/lucene-facet-3.5.0.jar
create mode 100644 src/DVN-EJB/src/java/edu/harvard/iq/dvn/core/index/DvnQuery.java
create mode 100644 src/DVN-EJB/src/java/edu/harvard/iq/dvn/core/index/ResultsWithFacets.java
create mode 100644 src/DVN-web/src/edu/harvard/iq/dvn/core/web/study/FacetResultUI.java
create mode 100644 src/DVN-web/src/edu/harvard/iq/dvn/core/web/study/FacetUI.java
murphy:dvn pdurbin$
murphy:dvn pdurbin$ git status
# On branch develop
# Your branch is ahead of 'origin/develop' by 68 commits.
#
nothing to commit (working directory clean)
murphy:dvn pdurbin$
murphy:dvn pdurbin$ git push
Counting objects: 51, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (19/19), 1.41 KiB, done.
Total 19 (delta 7), reused 0 (delta 0)
To git@github.com:IQSS/dvn.git
b7fae01..2b88b68 develop -> develop
murphy:dvn pdurbin$
We should really only need to switch from the develop branch to the master branch as we prepare for a release.
First, we check out the master branch by clicking Team -> Git -> Branch -> Switch to Branch.
Change Branch to "origin/master" and check the box for "Checkout as New Branch" and fill in "master" as the "Branch Name" to match the name of the branch we're switching to. Then click "Switch".
Now, in the Git Repository Browser (from Team -> Repository Browser) the root of the tree should say dvn [master] and you should see two branches under Branches -> Local. master should be in bold and develop should not.
FIXME: explain how to merge commits into master for a final release (and how to tag the release)
