Author Topic: git experts ?  (Read 2711 times)

Tom

  • Head Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 6320
  • Karma: +102/-15
    • View Profile
    • Might & Fealty
git experts ?
« on: November 14, 2013, 01:09:30 PM »
Are there git experts in the audience?

I've received a few offers from people to help in the development and would like to give them access to just the parts of the git repository I host my code in that is relevant to them. For example, the CSS and JS directories, or the images/artwork directories, or the translation files.

Apparently submodules are the way?


MacManus

  • Jr. Member
  • **
  • Posts: 80
  • Karma: +4/-3
  • Regent of Iarann Mara
    • View Profile
    • TIN
Re: git experts ?
« Reply #1 on: November 14, 2013, 01:57:56 PM »
It seems like an effective solution imo, allows you to have separate commits for the submodules so you can see what changes have been made to each individual submodule separately.

Tom

  • Head Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 6320
  • Karma: +102/-15
    • View Profile
    • Might & Fealty
Re: git experts ?
« Reply #2 on: November 14, 2013, 03:48:38 PM »
Only thing I dislike is that it also means when I change stuff across the project, e.g. add something new which also needs new template files and new translation strings, it means I have to submit the changes to lots of submodules, right?

MacManus

  • Jr. Member
  • **
  • Posts: 80
  • Karma: +4/-3
  • Regent of Iarann Mara
    • View Profile
    • TIN
Re: git experts ?
« Reply #3 on: November 14, 2013, 06:35:09 PM »
Well from what I was reading the submodules act more like folders within the parent git so I would imagine that the parent git would commit changes to the submodules as well, or in theory that's what it makes it sound like. Could you briefly explain the structure of the system? Maybe that would give us a little more insight in to it and we could think of an effective solution or if submodules would work for this.

Tom

  • Head Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 6320
  • Karma: +102/-15
    • View Profile
    • Might & Fealty
Re: git experts ?
« Reply #4 on: November 14, 2013, 08:12:38 PM »
Hm, what I read about submodules seemed more like it would remember that this folder is handled by a different repository and only track which revision, but not include changes in its own repository.

My directory structure is the standard Symfony2 layout:


Of that, translations, views and public might have to be opened to others.

De-Legro

  • M&F Dev Team
  • Sr. Member
  • *****
  • Posts: 3130
  • Karma: +105/-55
    • View Profile
Re: git experts ?
« Reply #5 on: November 14, 2013, 10:35:58 PM »
Hm, what I read about submodules seemed more like it would remember that this folder is handled by a different repository and only track which revision, but not include changes in its own repository.

My directory structure is the standard Symfony2 layout:


Of that, translations, views and public might have to be opened to others.




Are you trying to restrict read access as well as write access?
He who was once known as Blackfyre

Tom

  • Head Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 6320
  • Karma: +102/-15
    • View Profile
    • Might & Fealty
Re: git experts ?
« Reply #6 on: November 14, 2013, 11:41:05 PM »
Are you trying to restrict read access as well as write access?

If git could restrict read access, I wouldn't need sub-modules. :-)


De-Legro

  • M&F Dev Team
  • Sr. Member
  • *****
  • Posts: 3130
  • Karma: +105/-55
    • View Profile
Re: git experts ?
« Reply #7 on: November 14, 2013, 11:59:01 PM »
If git could restrict read access, I wouldn't need sub-modules. :-)


Yeah I know, but Sub modules have a few gotcha's that can really catch out people that aren't experienced with GIT. Things like remembering to create a branch of a sub module any time you want to do work on it so you don't potentially screw up the pointers if other users run an update before you commit.


While you can use sub modules for what you want, really they are supposed to be for things that have separate life cycles. You might use a sub module to link to a 3rd party repository and you want to keep it at a certain revision until you CHOOSE to update it.


Only thing I dislike is that it also means when I change stuff across the project, e.g. add something new which also needs new template files and new translation strings, it means I have to submit the changes to lots of submodules, right?


Yes standard workflow is push to each sub module, then update sub modules in your main repository. The other aspect of this is that you will need to update the main repository whenever someone updates a sub module, in order to keep everything in sync.


Depending on how you set up people access to the sub modules they will also need to remember that a simple PULL command doesn't update the sub modules they have access to as well.
He who was once known as Blackfyre

Tom

  • Head Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 6320
  • Karma: +102/-15
    • View Profile
    • Might & Fealty
Re: git experts ?
« Reply #8 on: November 15, 2013, 12:10:48 AM »
Ok, so sub-modules aren't the way to go.

Then what is?

De-Legro

  • M&F Dev Team
  • Sr. Member
  • *****
  • Posts: 3130
  • Karma: +105/-55
    • View Profile
Re: git experts ?
« Reply #9 on: November 15, 2013, 12:17:21 AM »
Ok, so sub-modules aren't the way to go.

Then what is?


Honestly, they are your only option to restrict read access that I know about. GIT was never really designed to restrict read access, hooks won't work for it like they will commit access. To me it looks like when GIT was create it was assumed that read access should be universal.
He who was once known as Blackfyre

Moebius

  • Full Member
  • ***
  • Posts: 131
  • Karma: +5/-2
    • View Profile
Re: git experts ?
« Reply #10 on: November 15, 2013, 08:01:46 AM »
As Blackfyre says, submodules are the only practical way of doing this.

I don't think the branching aspect should be problematic; a simple approach is just to use 'master' for all development, and a 'production' branch for release.  These are just frontend templates and static resources.

It should be a relatively pain free process I would think.  The main (unavoidable) drawback is that contributors won't be able to work on a local instance of the whole codebase to test things; they'll presumably either have to just work 'blind' or perhaps be able to initiate (or request) deploys to a central test server.

We're not talking about a situation where each contributor would have access to the parent repository anyway, so the typical problem of having to update submodules to get a fresh tree is not an issue here (except for the central deploy process, which is unavoidable anyway).
« Last Edit: November 15, 2013, 10:45:13 AM by Moebius »
Might & Fealty characters: the House of de Rodon, of the Duchy of Forest Hold, Erstes Imperium.
---
In BattleMaster I played as Matthias, Rodon and Kali.