Warning: Creating default object from empty value in /home/jfcouture/jfcouture.com/wp-content/themes/platform/core/library/class.layout.php on line 159

Warning: Creating default object from empty value in /home/jfcouture/jfcouture.com/wp-content/themes/platform/core/library/class.layout.php on line 162

Warning: Creating default object from empty value in /home/jfcouture/jfcouture.com/wp-content/themes/platform/core/library/class.layout.php on line 165

Warning: Creating default object from empty value in /home/jfcouture/jfcouture.com/wp-content/themes/platform/core/library/class.layout.php on line 168

Warning: Creating default object from empty value in /home/jfcouture/jfcouture.com/wp-content/themes/platform/core/library/class.layout.php on line 171

Warning: Creating default object from empty value in /home/jfcouture/jfcouture.com/wp-content/themes/platform/core/library/class.layout.php on line 173

Warning: Creating default object from empty value in /home/jfcouture/jfcouture.com/wp-content/themes/platform/core/library/class.layout.php on line 175

Warning: Creating default object from empty value in /home/jfcouture/jfcouture.com/wp-content/themes/platform/core/library/class.layout.php on line 197

Warning: Creating default object from empty value in /home/jfcouture/jfcouture.com/wp-content/themes/platform/core/library/class.layout.php on line 201

Warning: Creating default object from empty value in /home/jfcouture/jfcouture.com/wp-content/themes/platform/core/library/class.layout.php on line 224

Warning: Creating default object from empty value in /home/jfcouture/jfcouture.com/wp-content/themes/platform/core/library/class.layout.php on line 225

Warning: Creating default object from empty value in /home/jfcouture/jfcouture.com/wp-content/themes/platform/core/library/class.layout.php on line 226

Warning: Creating default object from empty value in /home/jfcouture/jfcouture.com/wp-content/themes/platform/core/library/class.layout.php on line 316

Warning: Creating default object from empty value in /home/jfcouture/jfcouture.com/wp-content/themes/platform/core/library/class.layout.php on line 316

Warning: Creating default object from empty value in /home/jfcouture/jfcouture.com/wp-content/themes/platform/core/library/class.layout.php on line 316

Warning: Creating default object from empty value in /home/jfcouture/jfcouture.com/wp-content/themes/platform/core/library/class.layout.php on line 316
Djief's Blog

Quick update on where I’m at:

You can follow me on:

Popularity: 1% [?]

 

What do you call someone who works at Code Genome?

Garden Gnomes

That’s right, a garden gnome. (Apparently, some British dude had trouble saying the name of our company.)

Need test? Pass drug test passing drug test.

It is with great pleasure that I announce that a new gnome has joined the team: Pierre Olivier Martel. PO is our first rails garden gnome guru-to-be. Welcome aboard PO!

Popularity: 25% [?]

 

(company name) Code Genome, based in (city name) Montreal, the world leading (whatever it is you do) Ruby On Rails consulting firm, is looking to hire (position name) a Ruby On Rails developer for its (adjective) star team.

(Mad Libs are are the ultimate tool to create a job posting.)

Ruby on Rails Guru

We are looking for a Ruby on Rails guru. You have a couple of projects under your belt (a black one). Everything you ever wrote ended up in a plugin. You’re just that good. You should be the one writing this job description and telling us what a real Rails guru is all about.

Ruby on Rails Refugee

We are looking for a Ruby on Rails refugee. You have a couple of years of experience in web development in Java or .Net. One night, you built a small project in Rails, wanting to know what the hype was all about. It was love at first sight. Now, you loathe your day-time job and all the unnecessary complexity involved. It’s time for a change.

Ruby on Rails Guru-to-be

We are looking for a Ruby on Rails guru-to-be. You have built at least one small project in your spare time using Rails and fell in love. You are now aspiring to have an international career as the next rock star of ruby development. But you need someone to give you a chance.

For more information, visit http://jobs.codegenome.com

One more thing. The best part of this job is that you get to work with me, the only ruby witch doctor in Montreal. Oh, and if you feel guru is overused, you get to call yourself whatever you want: ninja, kung fu master, sith lord, drunken monkey cowboy of hell, papa smurf, or the ultimate, zombie ninja pirate. Nothing beats a zombie ninja pirate.

Popularity: 16% [?]

 

I didn’t think I would blog about the launch of github, because I thought it was pretty meh. Sure it’s nice to put your projects on it and be able to fork other projects, but it was still pretty useless as there was no way of visualizing all the branches (git is all about the commit graph).

Well they just launched the Network Graph Visualizer and it rocks! Now you can quickly see the branches/forks and know if they are active or not. Also they added commit comments.

So they fixed their most important flaw and they add features that should make collaboration easier. This makes me really hopeful for github’s future. Github is the place to be for open source projects!

Popularity: 40% [?]

 

You might have heard about distributed version control systems recently, for example git. There are a lot of articles popping up left and right about DVCS. What I find interesting about this is that version control has again become something to talk about. This is very healthy as version control is such an important tool for software developers.

When I started using using subversion five years ago, version control faded to the background. Subversion greatest strength is its simplicity. After a while, you get used to its quirks and it just works. Sure, some operations are painful, like merging back a branch, but you learn how to do it (and try to minimize to number of times you have to do it).

But five years is a pretty long time in computing terms. Maybe something better has come along. Maybe the reasons you chose something five years ago don’t hold anymore. This applies to everything. Sometimes you come across a company policy that looks stupid. At the time the decision was taken, it might actually have made sense. But things changed (as they tend to) and nobody took the time to check if the assumptions used to make the decision were still true today.

I suggest you use all the hype around git, and the discussions it generates, to revisit, to question all your assumptions about what is version control and what it can do for you. Is version control about sharing code with other developers and having some kind of history and backup? That’s something that, yes, it provides, but it can do so much more.

Have you ever used a VCS that required you to lock a file before editing, to avoid conflicts if two developers edited the file at the same time? If you’ve used any system that doesn’t require it, you just know that it’s a not a real problem. However, how do you explain it to the developer that is convinced that it is a very real problem? That’s the problem I have with git right now after using it for six months. I don’t how to convince people to try it when they raise objections. I can only say that it’s awesome and that going back to subversion from git would be more painful for me than going back to locking file from subversion.

Popularity: 15% [?]

 

It appears that Rails will switch to git real soon. Nice! However, it means confusion for developers used to svn. You might find a few tips on this blog to help you get started, but right now I want to give you the secret to git mastery:

You need to think in terms of how you want to modify your graph. My what you say?!? A git repository is a directed acyclic graph of commits (the nodes). Huh?? Read this article: Git for Computer Scientists. Do not continue reading before you understand that article. Everything falls into place when you understand that all git commands manipulate these four basic structures: blobs, trees, commits and tags.

From now on, before typing a git command in the shell, try to picture in your head how you want your repository to look after the command. Your best friend is gitk for visualization (use the –all option to see all branches). Run it before and after each command you do with git. Here is what you should be thinking when using these commands:

  • git commit: I am creating a new node in my graph, linked to the current node.
  • git branch branch_name: I am tagging a node with a name.
  • git merge: I am creating a new node that will link two parents nodes, one for each branch I am merging (could be more than two).
  • git fetch remote_repos: I am adding all the nodes from a distant repository to my graph.
  • git push: I am sending all the nodes I created to a distant repository.
  • git pull: I want to fetch all remote nodes AND merge.

Once you think like this, “advanced” git stuff becomes trivial. For example, this morning one coworker realized that his last three commits actually belonged to a branch. Try to visualize the solution. When you think about it, nothing has to change about the actual graph, just which nodes the tag (the branch name) needs to point at. So you just create a branch where you are, on the last commit, and then you can use the reset command to move back the other branch to the correct commit.

That’s the core of git. There are maybe two other things to worry about when using git. The first is the index, which is sort of a staging area where you prepare your commits. The other thing is the way git configuration works and the way it names and references branches (and the special reference HEAD) and remote repositories. Check out the git user manual.

Popularity: 28% [?]

 

I’m beginning to wonder if I wasn’t a bit pessimistic when I said 80% of rails developper to switch to git before christmas ’08. My own unscientific measurement for January show more than 50% of new projects are using git. If you still haven’t installed git and are looking for a reason, here’s one: Dr Nic is the new maintainer of the Rails Textmate Bundle and you’ll need git to get it. It includes new helpers specific to Rails 2.0. Speaking of Textmate, it looks like someone picked up the development of the git bundle. January also saw the release of thin and the next version of merb is now also on git. Seriously, I don’t think I need to keep pushing people to git anymore. The momentum is too strong and you will have to use git in the very near future. If you still need more convincing, here are a couple of very interesting links:

Hopefully all the links provided should help you understand git from different perspectives. One last goodie for the week: Carl Mercier released a small script to help work with remote branches. If you want to script common git tasks in ruby, take a look at Ruby/Git.

Popularity: 19% [?]

 

Git does not require a special “server” to run. For example, if you are on a local network, you can just put the repository on a shared network drive. Git does not handle the security. You configure the read/write access on the folder. I’m not an expert in system administration so I’m going to suggest some options and provide links that I found helpful:

  • Ssh is you friend for security. If you do not want to provide shell access to everyone, you can setup one git user and use ssh keys to provide access. If you go that route, take a look at gitosis, which is a bunch of python scripts that automates part of administering that kind of setup. Gitosis gives you a git repository to configure access and projects. It’s very nice.
  • Another option is through http. You need webdav for that.
  • Git daemon comes with git and is perfect if you only need to quickly give public read access.
  • There are couple of git hosting site that are popping up. Check out repo.or.cz and Github (invitation only for now but has a sexy look).

Popularity: 100% [?]

 

Last night I presented git at Montreal On Rails and I think it went pretty well. I might have forgotten a few things I wanted to say, but I got quite enough question about other aspects of git to fill an hour, aspects that I didn’t expect to be able to squeeze in. Although git is a very different beast than subversion, I feel like most people understood what it is all about. We have some very smart people here in Montreal, and it sure does not look like a ghetto. ;)

Now let me remind you of your homework for the week (it leads toward the path to git enlightenment):

  • Listen to Linus Torvalds git talk at google. It really helps understanding the design of git.
  • Install git.
  • If you are currently using svn, see my guide on how to start using git while keeping a central svn repository.
  • Explore parallel universes with branches. Develop a new feature in a branch. Try out a plugin in a branch. Have a branch with rails edge. Do some crazy experimental refactoring in a branch, including renaming files (yes! git will correctly merge).
  • Play with git. Set up local “remote” repository to experience what distributed version control is all about. Try out strange branching scenario just to see how git will handle it.
  • Read the documentation. See if you can find how to: commit only part of file, send your last 3 commit to another branch, change your last commit (there are 2 ways actually).

I got carried away there. Git rocks.

Popularity: 20% [?]

 

You just installed git. Now it’s time to set it up. First, you want to set up your name and email, which will be added to your commits:

$ git config --global user.name "Your Name"
$ git config --global user.email name@email.com

Another useful option is alias. We can also use the command line to set it or we can edit ~/.gitconfig:

[alias]
	st = status

This means we can just type git st instead of git status. As you get more familiar with git, you’ll want to add your own aliases.

Check the manual for the complete list of options.

Change gitk fonts

Gitk looks bad. Really bad. We can improve it by changing the default font. You need to edit ~/.gitk:

set mainfont {Monaco 10}
set textfont {Monaco 10}
set uifont {Monaco 10}

Much better.

Bash completion

Lookup contrib/completion in the git source directory. Git-completion.bash includes the instruction to set it up. You need to copy that file somewhere and source it in your ~/.profile. Once this is done, you can press tab to complete git commands, options and the name of branches in bash. The script also adds __git_ps1 which you can use in your PS1 to include the name of the current branch in your bash prompt. Because you will use branches with git, it can help you remember that you switched branch just before leaving work the day before.

Popularity: 47% [?]