Random Git Stuff

Switching between projects using different SCMs is painful sometimes, and I always fail to remember the branch I’m on in my Git repositories. I use some bashrc/PS1 magic to show some SCM information in my PS1, I thought someone would find it useful: bashrc-scm.

Lately I’ve been working on RepoDoc whenever I’ve found a bit of free time. We are using Git as our SCM mainly because it is easy and very flexible and we can follow a pseudo-centralized workflow that probably only suits us 🙂 We faced some problems with it but given the flexibility of Git, fixing them was really easy.

We keep a central repository with one branch per committer plus master. Those are the top-level branches, and not everybody can update every brach, so the traditional Unix filesystem permissions doesn’t solve our problem. Then we can create as many temporal branches as we want under the tmp/ directory.

Also, we decided to keep a ‘fast-forward only’ policy on top-level branches, so everything has to be cooked in temporal branches first and then cleanly merged into top-level branches.

To enforce both policies (permissions and ‘fast-forward only’) we call a script from the update hook who does all the magic: http://dev.gentoo.org/~ferdy/stuff/enforce-perms. The users-allowed file is something like:

refs/heads/master$  alice bob
refs/heads/alice$   alice
refs/heads/bob$     bob
refs/heads/eve$     eve
refs/heads/tmp/     ^
refs/tags/          alice

Today I also decided to hack a CIA bot to send repodoc stats. It was fairly easy since the ciabot.pl included in Cogito did almost everything I wanted. However, being a perl-ignorant I rewrote the whole thing in bash to suit my needs, grab it from http://dev.gentoo.org/~ferdy/stuff/ciabot.bash.

For those with the ability to read or understand some Spanish I wrote a little introduction to Git: http://dev.gentoo.org/~ferdy/git-intro/

I have also been trying to import the gentoo-x86 module into Git without much luck, both parsecvs and git-cvsimport failed, I’ll probably try Tailor later. I haven’t payed much attention to it anyway, since I’m a bit busy with university stuff. I guess I should seek help in the Git mailing list once I take it seriously.

Oh, and by the way, there is a new Git version in the tree. Go grab it!

– ferdy