Cookie Notice

As far as I know, and as far as I remember, nothing in this page does anything with Cookies.

2011/12/05

Questions about Git

I'm reading Eric Sink's Version Control By Example, starting to hit the examples, and I'm finding that to be a bit of a problem.

Eric's example is one dev in Birmingham, UK and one in Birmingham, AL, writing C code and committing to a server in Cleveland. Right now, the dev team for my office are two coders separated by all of five feet, writing Perl code for one of two servers, one being the web server. I'm easing in to git, as you might guess by the reading material, and like most working environments I've been in, our version control system has been "copy a backup before you muck with the file", which I know is dumb and useless (especially in the lab, where we rely on RAID for data protection and thus don't really have backups). I'm kinda taking the lead on this, having been burned enough to want to protect myself, but I don't really know much of it.

I've been using git so far to keep track of changes locally, just doing git init and git commit within the local file system. Is this enough? Or do we really, truly need a server?

And the code sits in /home/user/web/cgi-bin/foo/bar/blee/quuz.cgi or /home/user/bin/hoge.pl, I'm wondering: should I have those be the directories to run git in? Or should I do the work in /home/varlogrant/dev/hoge.pl/ and copy hoge.pl over to /home/usr/bin when I'm happy with it and it has been committed?

I have a bigger question on how to take a large selection of interconnected Perl modules and make them 1) test driven in the real, chromatic-approved way, 2) working with git in a useful way, and 3) usable from ~/lib on several dissimilar systems. I have a cheap hack on #3, but if I break apart and reassemble the modules, I can probably do it cleaner and smarter.

4 comments:

  1. Or do we really, truly need a server?
    Since git is a DVCS, there is no server per se. You can easily set things up like in the SVN model and declare one repository the anointed one. If your machine is well-connected, it can be the one and no extra hardware is necessary. However, setting up on a dedicated server somewhere usually is a better idea so that the sysadmins can care for it properly, and so you can install some ecosystem around it, e.g. a browsable Web interface.

    should I have those be the directories to run git in
    You're mixing up working on a file/storing it in the VCS with deployment. Please do have a separate deployment step. In the most simple case that's a Makefile calling install (from GNU coreutils). If the project is very Perl-centric, following the standard practices and using Module::Build is not a bad idea, either. If you describe your software in detail, one may make specific recommendations; there's rarely something new under the sun and thus there is a diversity of pre-canned recipes for certain situations. Come to irc.perl.org #toolchain for advice.

    ReplyDelete
  2. development vs deployment: I was thinking that was an issue, but what little I've done with git so far has pushed me toward that, creating ~/dev for working with my stuff and ~/bin for deploying them once I'm happy with them. That works for scripts, as the big difference between ~/bin and ~/dev is that ~/bin is in my path.

    Where it works less is the rest of the work, which is the web-based interface for our genomics lab. The scripts must be in the CGI bin to be tested, and we do not (yet) have a development server. Once we do, that'll help a lot.

    Thanks

    ReplyDelete
  3. RAID is not data protection, it is hardware protection. Assuming it's RAID 5 (or RAID 1 to a lesser extent) , that means if a drive fails you can easily swap it out.

    A nice side benefit is that if it is RAID 5 (or sort of RAID 1) that if a drive fails it isn't taking your data with it.

    RAID 0 is even worse, it just makes one big chunk of storage and if a drive fails, well so sorry about your data.

    Data is only protected if a copy or twenty exist elsewhere and a restore can be made from it.

    /end sysadmin rant

    ReplyDelete
  4. gizmo: I know! I know! I know! I'm pretty sure that it's RAID 5 set as conservatively as possible over a fairly large array, so my data is on several discs, so no worries unless I'm stupid. Problem is, I've been known to be stupid. I have my ~/bin and ~/dev directories on desktop shared to Dropbox, just because once I was stupid with code I cared about. But that's my desktop, not the server.

    Which is why I'm now so interested in learning git.

    ReplyDelete