2

I am using gitosis to manage a bunch of private repositories. Everything works great and I have no issues with how we add repositories as such. The problem is that we have relatively few developers but lots of repositories, particularly since one of our projects uses git submodules quite heavily.

This means that the gitosis.conf is starting to get a bit unwieldy and I was wondering if there is any way to tidy it up. At the moment we use something like:

[group developers]
writable = repo1 repo2 repo3 (...) repo20 repo21 repo22
members = dev1 dev2

And when we want another repo we add it to the end of the writable list. The problem is that already this list is getting hard to read and we don't even have all our projects in yet. I know this is real nit-picking in what is otherwise an excellent setup but I was just wondering if anyone has any handy hints or tips to share on better ways to organise the gitosis.conf

Cheers

Addsy
  • 3,944
  • 2
  • 32
  • 35

4 Answers4

2

You can use multiple lines like this:

[group developers]
writable:
 repo1
 repo2
 repo3
 (...)
 repo20
 repo21
 repo22

members:
 dev1
 dev2

To display the history before using one item per line, you can use git log -p --color-words.

Tobu
  • 24,771
  • 4
  • 91
  • 98
1

Another solution would be to create your own conf file with the syntax you find more convenient, and create a script to transform that into the gitosis.conf file.

Then you could use wildcards and regex to match repository names, such as:

repo-* or repo-[\d]+ to match repo-1, repo-2 etc.

rafalotufo
  • 3,862
  • 4
  • 25
  • 28
  • Thanks for the suggestion. I think one of the methods mentioned above may be sufficient for now but I will bear the idea in mind as it seems like it may be useful if and when the previous option starts to become unwieldy. Cheers – Addsy Jun 30 '11 at 07:57
0

gitosis.conf enables the creation of developer groups, and then assign them repositories. The other way around would be configure repositories and for each assign them developers.

I don't think that either of these solutions would be better in this case. It seems to be a hard task. So I would ask: is it really important that some developers have access to one site, and not to another? If not, then just create a one group, and list all sites :)

rafalotufo
  • 3,862
  • 4
  • 25
  • 28
  • Yeah, to be honest, I am not mad fussed about permissions. We need to know who changed what but we're pretty open and there's not really an issue with who can and can't see or even commit to particular projects. It's more about the way we list them in the gitosis.conf - all on one line. I was asking more about the possibility of things like wildcards, breaking onto several lines, things like that. Sorry if that wasn't too clear – Addsy Jun 29 '11 at 16:48
0

gitosis is no longer maintained and supported by the author; most people usually recommend gitolite instead which has much better documentation and more features.

As long as I am advertising, I might as well advertise gitslave as a simplier alternative to git-submodules for people where all of the repositories are locally developed and there doesn't need to be a tight binding (except for tags) between which revision the master and slave repositories are at. It is better for some workflows, worse for others.

robert
  • 33,242
  • 8
  • 53
  • 74
Seth Robertson
  • 30,608
  • 7
  • 64
  • 57
  • 1
    gitolite is neat, but this should be a comment. – Tobu Jun 29 '11 at 18:01
  • Cheers for that. I had seen gitolite but I don't want to meddle with an already working setup at the moment - just wanted to do a little bit of tidying. Cheers for the heads-up on gitslave as well. Had a quick look through and seems interesting so I will bear it in mind – Addsy Jun 30 '11 at 07:54