CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Getting with GIT
Pages: [1]

Author Topic: Getting with GIT  (Read 956 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Getting with GIT
March 18, 2012, 03:16:26 pm
I've delayed going to 4.1 because of patch management issues but now I need to set up a strategy to manage a patched version of 4.1. I'm expecting to do this via GIT & am trying to figure out the approach / issues.

Background

Towards the end of the last release cycle we stopped installing from the official release & switched to having our own 'fork' in subversion. Our fork is simply a heavily patched version of the 3.4.7/ 4.0.7 release and we have taken steps to manage all the patches into core. However, some of our patches (e.g. http://issues.civicrm.org/jira/browse/CRM-5869) are going into 4.2 rather than 4.1 so as we embark on 4.1 we already have patches we are going to have to manage for the entire 4.1 cycle.

Going forwards
So, I'm expecting that basically I will
  • clone the git repo at gitorius (https://gitorious.org/civicrm) which I've done
  • run php Gencode to generate the DAO & commit them back to our clone
  • clone my repo to all our sites
  • when I want to patch our sites I will commit the patch to our clone (and then git pull to update our sites). I also need to ensure that the patch will go into Core at some point & have the various discussions on IRC, JIRA, Forum involved in that.
  • when I want to update our git repo I'll do git pull --rebase to get updates from core. 
  • Do a git diff between my repo & core to check that I'm not storing non-differences - e.g if a patch I have has been incorporated but with an extra line I want to eliminate that (not quite sure the commands here yet)

The questions this leaves me with are
  • I think it would be risky to rebase against the latest version of the 4.1 branch & I probably need to rebase against a specific release point (ie. 4.1, 4.2) because those are the points at which people so a check on the code & ensure all tests are passing. However, those points are not currently branches. How do I hook up against them?
  • DAO - Is our change freeze robust enough that I can be confident I only need to generate the DAO once per release cycle?
  • Should I keep a branch per release in My Repo - I'm thinking I probably should

Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Getting with GIT
March 18, 2012, 03:31:57 pm
Actually it's possibly trickier than that - I will need to have 3-4 versions of our git repos - all with the same patches. Because we will need a drupal 6 & a drupal 7 branch and an internationalisation branch - possibly for each level.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Getting with GIT
March 18, 2012, 04:56:52 pm
NB - X has pointed out the official git mirror hasn't had a commit since 30 Jan
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

jamie

  • I post occasionally
  • **
  • Posts: 95
  • Karma: 6
Re: Getting with GIT
March 20, 2012, 07:21:45 am
Yes - I've fallen down on the task of keeping the git repo in sync. I'm a bit overwhelmed with the complexities of keeping all the branches in sync. It's truly tested my svn and git skills.

However, that doesn't mean you can't start this strategy.

I would suggest that you use git-svn to create a local git repo based on the 4.1 branch of the subversion repository. This task is not super complicated (compared to keeping everything in sync). Your main git branch would track the subversion 4.1 branch. Your other git branches could be rebased against your main branch.

I've used a similar technique myself. When it comes to doing a major rebase from upstream, I've chosen to start with a fresh branch from upstream. Then, I review each local commit to determine whether I want it or not. If I don't, I do nothing. If I want it, I use git cherry pick to try to pull it in. If it cleanly applies, then great. If not, I fashion a new commit.

As for rebasing against HEAD vs a (non-existent) branch like 4.1.2, I would suggest that you rebase against a particular commit. We should be able to determine which commit was the last commit for a given point release.

hth,

jamie


Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Getting with GIT
March 20, 2012, 01:12:44 pm
Would it make sense to update the gitorius repo each time a stable version goes out for now? Then there would be a public git repo we could use rather than use? Or is that still pretty complex?
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

sdague

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: Drupal 6
  • MySQL version: 5.1.58
  • PHP version: 5.3
Re: Getting with GIT
March 21, 2012, 05:06:31 am
I have some experience with git-svn at scale because I was doing that for 9 months with the opensim project before I finally convinced folks to flip over to git for real. I've got a git-svn version of civicrm on my laptop, it took about 12 hours to generate first time, and is 760MB.

Are you just doing a git-svn tree? If so it should include references to all the branches (I've got one locally). From that you can do something like:

git log | grep -6 39075

To get the git change you want to work from. Then it should mostly be about rebases. I'm on IRC and feel free to ping me.

I'm also curious if there is general community interest in converting over to git as the base tool? The collaboration model with pull requests gets so much nicer on git, and it's a lot easier to get core code back in.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Getting with GIT
March 21, 2012, 06:20:30 am
Hi,

Definitely a lot of interested and pretty much everyone is convinced we should end up in Git.

This being said, the other projects having done the migration (drupal, git...) looked like it was a rough time. It would make the difference between a dream/long term project and a done one to have someone that has already a big experience in that that could step up and make it happen (hint hint)

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Getting with GIT

This forum was archived on 2017-11-26.