Subscribe to XML Feed
17 Dec 2009

This Year

So I basically stopped blogging this year, more or less since I started working for GitHub. I’ve been busy, what can I say? I wrote a technical book through APress publishing called Pro Git, I’ve traveled all over the world speaking at dozens of conferences on Git and GitHub, and my wife had our first child, Josephine.

I think writing the book is what really killed the blogging. I was writing for hours every day or two, then spending hours each day the next week reading over comments telling me how I was both technically wrong and generally bad at writing in English. Sitting down and writing a blog post wasn’t really what I wanted to do after that.

Travel-wise it’s been a pretty amazing year. According to Tripit, I’ve traveled 74,360 mi to 31 cities in 11 countries over the course of 80 days this year. That’s almost a quarter of the year on the road. This year alone I’ve been to Shanghai, Tokyo, Amsterdam, Edinburgh, Berlin (twice), Poznan, Stockholm, Oslo, London (twice), Barcelona, Madrid, plus San Diego, Boston, Vegas, Chicago, New York, Virginia and Honolulu.

Physically I’ve changed kind of a lot, too. I got more or less in shape again this year, mostly due to a simple routine of running and the hundred pushups program. Though I haven’t quite yet made it all the way to 100 pushups in a row, I can now do about 70 or 80, which is pretty cool. I also lost about 30 pounds this year, from a high of about 195 when my baby was born to about 165 now.

Finally, there is Josephine. When the year started, Jessica was a couple months pregnant and now we have a little 5 month old baby girl. I was never really a fan of all the “it changes your whole life” comments, but it really does. It is by far the most amazing thing that has ever happened to me. She even has a little passport already and has traveled to Hawaii and Spain with us.

Overall, this has been one of the most amazing years of my life, and I’m really quite sad that I didn’t write more during it. I will definitely try to reverse that trend over the coming year as I have more amazing trips coming up (for example, Australia, New Zealand, Paris, Ireland just in the next few months), and there will be no shortage of baby stories and GitHub amazingness.

Looking forward to this year, everybody. Skál!

View Comments
11 Feb 2009

Moved my blog to GitHub Pages

It’s been a while since I made a big blogging change - I’ve been on Wordpress for a pretty long time now and have generally liked it, but the theme wasn’t so hot and the general zeitgiest of my postings have veered much more into programming than politics over the last year or so. So, I thought it might be time for a change.

As of this post, my blogging software of choice is Jekyll and my new hosting provider is GitHub Pages. Which is pretty cool for me, since I am part of the small team here at GitHub.

In the past, I have had two catastrophic data losses from my hosting providers losing a good number of my posts. Each time I thought I would finally remember to setup something that would back them up, but I never did. Now I finally have a secure backup for my blog data, since everything is done via a Git repository. How it works is I keep the source for my blog in a specially named GitHub repository and every time I push to it, GitHub pixies automagically generate my static blog pages for me.

So, now my blog and content are all available via a public Git repository, if you’re interested in using it for anything. I copied the theme and javascript from Michael Bleigh, and you’re welcome to copy it from me, in turn (do remember to credit Michael, though).

I do love GitHub.

View Comments
02 Feb 2009

London Git Training

Git London Bus

At the end of March, I’m going to be traveling to Europe for Scotland on Rails to do a Git talk (also likely a talk at the University of Edinburgh, if you’re there).

While there, I thought I would do a more in-depth training session in London for all our friends toiling in SVN heck or otherwise wanting to sharpen their Git-Fu. My friends at Codebase have helped me rent a space, catering and all that so we can have a nice long session learning the ins and outs of Git.

If you are interested in signing up for the training, which is happening on April 3rd (a Friday), you can check out our website at gitlondon.com. If you know anyone in the UK who might be interested in doing it, please do let them know. If you’re in the UK and don’t want to do the training, but do want to go out for beers after, send me a note.

View Comments
24 Nov 2008

On Mercurial

It seems that a rather popular theme when reading about distributed SCMs on a blog post is that someone says that they hate or love Git, where the hate is generally that it's hard to learn, unintuitive, etc. Then, generally without exception, a mercurial user jumps in on the comments and says something like "I tried Git, but it was impossible to learn, so I'm using Mercurial and it's easy-peasy". That person is wrong.
Git is not hard to learn. At least, not any more difficult than Mercurial is. There, I said it. If you think that Git is like learning Linux - powerful but steep in the curve of learning, while Mercurial is like Mac - more constrained, but far easier to learn, you have either tried the systems a long time ago or have never really tried them and are just repeating the Merc FUD.
Don't get me wrong, it certainly used to be this way. My point here is that if you take a fresh look at the two systems, the majority of beginner to intermediate tasks that you have to do with a DSCM are very similar in both systems and being sufficiently familiar with one takes very little effort to use the other.
I state this because of the incredibly scientific research I concluded tonight, wherein I used hg. I have been a Git guy for several years now and have never previously touched mercurial, and I dove right in a few hours ago and took some notes so I could share what is _not_ intuitive in hg, even from an advanced DSCM user, and to give it a fair shake. Here is what I have concluded:
  • Git and Mercurial have nearly the same learning curve
  • Some things are easier / more intuitive in Git, and some in Hg
  • Both systems have a similar number of overall common commands, of which 90% are identically named
  • You can pretty easily move from one to the other for basic tasks

Let me get into a bit of detail about what I found. As my first piece of evidence, I will look at the help menu. If you simply type 'git' or 'hg' on the command line, hg will give you the following 17 commands :
 add        add the specified files on the next commit
 annotate   show changeset information per file line
 clone      make a copy of an existing repository
 commit     commit the specified files or all outstanding changes
 diff       diff repository (or selected files)
 export     dump the header and diffs for one or more changesets
 init       create a new repository in the given directory
 log        show revision history of entire repository or files
 merge      merge working directory with another revision
 parents    show the parents of the working dir or revision
 pull       pull changes from the specified source
 push       push changes to the specified destination
 remove     remove the specified files on the next commit
 serve      export the repository via HTTP
 status     show changed files in the working directory
 update     update working directory

and Git will give you the following 21 commands:
   add        Add file contents to the index
   bisect     Find the change that introduced a bug by binary search
   branch     List, create, or delete branches
   checkout   Checkout a branch or paths to the working tree
   clone      Clone a repository into a new directory
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree
   fetch      Download objects and refs from another repository
   grep       Print lines matching a pattern
   init       Create an empty git repository 
   log        Show commit logs
   merge      Join two or more development histories together
   mv         Move or rename a file, a directory, or a symlink
   pull       Fetch from and merge with another repository 
   push       Update remote refs along with associated objects
   rebase     Forward-port local commits to the updated 
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from index
   show       Show various types of objects
   status     Show the working tree status
   tag        Create, list, delete or verify a tag object 

Take a good look at that, because there is not a lot of frickin' difference. If you know one, you basically know the other. I can attest to that because I didn't need to look up a lot to figure out how to use hg - not because it's so super simple, but because it's nearly identical (for the basic things).
One of the things I hear a lot is that Git has a billion esoteric commands that are cryptic, magical and impossible to remember. That... is true. However, it doesn't matter. What matters are the porcelain commands that are meant to be used by the end user, and there are about 30 of them - the 21 above plus some special stuff like 'stash' and 'submodule'. On the other hand, if you type 'hg help', you get a list of 41 commands.
Now, there are another 100 commands that git will respond to, but they are plumbing commands and are just there in case you want to build something novel - using them is the equivalent of opening up Mercurial and modifying the source. I happen to use a bunch of them to do some really weird stuff that is just not possible in Hg, but there is no reason users even need to know they're there. They are not in the path (as of 1.6) - out of sight, out of mind. As far as a new user is concerned, Git is simpler in it's command set then Hg.
Now, let's look at a simple use of hg - creating a new hg repo and commiting and import:
mkdir test1; cd test1
hg init
cp [files] .
hg add .
hg commit -m 'my message'
hg log

Now, let's look at the same thing in Git:
s/hg/git/g

It's exactly the same thing. clone, add, annotate*, commit, diff, init, log, merge*, pull*, push, rm, status - these are all basically identical in the two systems. (annotate is generally called 'blame' in git, but 'git annotate' will also work, and merge/pull work slightly differently but do largely the same type of thing) This is the core of both systems, these commands are what you spend nearly all of your time doing, and they are almost exactly the same.
Now for the fun part.

Things that are Confusing in Mercurial



I get to listen to Mercs take the high ground all the time about how git is hard to learn and the UI is confusing - now it's my turn. Here are the things I had to go look up because I didn't get it and even the 'hg help' wasn't helping.
You have to set your username via 'vim ~/.hgrc'
In Git, one of the first things you do is :
$ git config --global user.name 'Scott Chacon'
$ git config --global user.email 'schacon@gmail.com'

In Mercurial, far as I can figure, you gotta do that by hand. There is an 'hg showconfig', but no setter (again, far as I can tell). That means you have to look up a snippet of what the actual config format is and paste that into your ~/.hgrc file manually before your commits will stop complaining that no user is set. PITA.
There is no staging area
This is really just a Gitter wondering how Mercs do it, but the lack of a staging area is something I didn't know I would miss. The lack of control over what versions of what files you're committing seems like a huge, huge missing feature to me (again, only because I'm used to Git). People argue that it keeps it simpler, but you can get the equivalent functionality by adding a '-a' to the 'git commit' command every time, which a lot of people do. In my initial foray, that was the only place where Git was actually more complicated than Hg - ignoring the staging functionality takes an extra '-a'.
How do I setup a remote repository?
OK, I have this Hg repository, and I want to create a remote one and push to it. I know I am being an idiot here, but I literally could not figure out how to do this short of doing an 'hg clone ' and looking at the .hg/hgrc file to see what was added to allow 'hg push' to know where to go. I figured out that you could specify it on the command line, but the thought of typing a url every time I want to push made me throw up a little in my mouth. I could not find the equivalent of a 'git remote' where I could add and manipulate my remote repositories without editing the '.hg/hgrc' file. I couldn't find it in the hg book, either. Perhaps in the comments someone could enlighten me.
I setup a repo on BitBucket and the instructions on how to push into it were simply 'clone this', and then I assume you're supposed to pull your files in and then push, but what if you already have a repo? This drove me nuts, and I still don't know how to do it.
Then, for Act II of this little play, I wanted to know how to have another remote - say I want to be able to push my repo to my staging server for deployment and my central server for collaboration. Again, could not figure out how to add it - I ventured a guess and just copied the line in the config file and gave it a different name and that seems to have worked, but do you really have to edit the file to add a remote repository?
It also appears that something that happens incredibly frequently in your typical day is much more complex in Hg than Git - pulling. In Mercurial, you have to do three commands each time you want to pull (and merge) changes from your remote repository:
1  hg pull
2  hg merge
3  hg commit -m 'Merged remote changes'

In Git, that is effectively done with 'git pull'. Now, you can do that with Git:
1  git fetch
2  git merge --no-commit
3  git commit -m 'Merged remote changes'

But WHY? (as an amusing side-note, there is a Merc plugin that adds an 'hg fetch' command that does what 'git pull' does, so in hg: fetch == pull + merge and in git: pull == fetch + merge...)
Branching... poor, poor branching...
I passed out for a quarter second when I read this in the Hg Book:
The easiest way to isolate a “big picture” branch in Mercurial is in a dedicated repository. ... You can then clone a new shared myproject-1.0.1 repository as of that tag.

I was naive enough to think that branches living in entirely different directories was a thing of the past. How SVN of them. I cannot imagine living my life making local clones to effectively deal with long running branches. The book literally says:
"In most instances, isolating branches in repositories is the right approach."

Um, no thank you.
It turns out that the more I get into branching stuff, the more I understand why they advocate that you clone to branch. Everything is on one track - you can't commit something and then easily leave it there for work later and ignore it for the time being, which is what I use branches mainly for. It's like Mercurial is a one-track mixer with some post-it notes to remember where you were and Git is a multi-track board that starts with one and then allows you to snap on new tracks at any time. Not sure if that metaphor worked, but the constraint of not having cheap, real local branches would drive me batty.
When I tried to have two topic branches going at the same time (say a master branch and an experiment branch), it was rather painful. It worked OK until I went back and forth and then when I tried to push it gave me a:
$ hg push
pushing to http://bitbucket.org/Scotty/objective-git/
searching for changes
abort: push creates new remote heads!
(did you forget to merge? use push -f to force)

No! I didn't forget to merge, I want to have two branches! So, I forced it. Then, when I want to switch back to my other branch, it gives me this:
$ hg branch newbranch
abort: a branch of the same name already exists (use --force to override)

Yes, I know it does, I'm switching back to it, you bastard! So, you _can_ have several local branches being developed at the same time, but hg hates it and you cannot push one of them without pushing all of them. It looks like it stores them as sequential changesets but then stores the parents so you can technically recreate the history. However, it seems that you _cannot_ push your A branch without also pushing your B branch.
That. Is. Annoying.
Conclusion
Perhaps some of these things are simpler at first in Hg, but I don't really think they are that much easier (if at all), and the amount of flexibility you lose is so immense that I can't understand how anyone can think of Mercurial as anything other than 'Git Lite'. Same great usability, much less functionality. And if your answer to that is 'get X plugin', then why do you think you're winning the usability battle again?
That's it - I'll keep playing with Hg and sharing my thoughts (being as how they are sooo unbiased). In the meantime, I'll leave you with some more metaphors:
* If DSCMs were bikes, Hg would be the Git bike with the training wheels soldered on.
* If DSCMs were TVs, Git and Hg would turn on to the same channel, but then Git would also have cable.
* If DSCMs were GPS units, both would have places of interest, but Git would also come with the street maps and be able to do driving directions.
* If DSCMs were shoes, you could play basketball in either, but Git would have the pump (for when you needed extra jumping and whatnot)
* If DSCMs were alarm clocks, they would both wake you up, but Git would also make you coffee.
(if you have others, please share - again, the theme is that they're the same out of the box, but then the one is ultimately a lot more useful)
View Comments

Older Posts

Why? Why why why why why? 02 Nov 2008 Comments
A GitHubber Now 02 Oct 2008 Comments
Git Community Book 05 Sep 2008 Comments
The Launch of git-scm.com 25 Jul 2008 Comments
Fuzed and EC2 06 Jun 2008 Comments
RailsConf Git Talk 02 Jun 2008 Comments
GitCasts - Git Screencasts 20 May 2008 Comments
Peepcode Git Book 29 Apr 2008 Comments
Ruby Reporting with Munger 18 Apr 2008 Comments
PublicMarkup.org 31 Mar 2008 Comments
TicGit and a new Git gem 23 Mar 2008 Comments
Git-Ruby Library Benchmarks 14 Mar 2008 Comments
Git-Ruby Success 11 Mar 2008 Comments
Ruby/Git and Git-Ruby 09 Mar 2008 Comments
GitHub invite 20 Feb 2008 Comments
Voting for Barack Obama 05 Feb 2008 Comments
Git and Rails News 29 Jan 2008 Comments
Rails 2.0 Presentation 14 Dec 2007 Comments
gitr - pure ruby git command line client 27 Nov 2007 Comments
Ruby/Git and gitweb.rb 19 Nov 2007 Comments
gitweb.rb interface 19 Nov 2007 Comments
Git and Rails 02 Nov 2007 Comments
Using Git to Manage and Deploy your Rails Apps 01 Nov 2007 Comments
Rails Rumble Screencast 26 Sep 2007 Comments
Rails Rumble Voting 14 Sep 2007 Comments
Such a Long Time 13 Sep 2007 Comments
Site5 Screw Up 24 May 2007 Comments
Kisumu Water Tank Drive 25 Apr 2007 Comments
Fellow Bylo Chacon 24 Apr 2007 Comments
Ruby, Python and Closures 27 Mar 2007 Comments
Pirates Cove 26 Mar 2007 Comments
FizzBuzz 23 Mar 2007 Comments
Gorillas Redux 21 Mar 2007 Comments
Garmin Forerunner TCX file processing code 21 Mar 2007 Comments
Weekend Run 19 Mar 2007 Comments
Rwanda using Google Apps 19 Mar 2007 Comments
Orange Peel 19 Mar 2007 Comments
A Day at Work 19 Mar 2007 Comments
My New Toy 18 Mar 2007 Comments
My New Phone 17 Mar 2007 Comments
Sunlight Gillibrand 10 Jan 2007 Comments
Elfs Lament 08 Jan 2007 Comments
Blog Back Up 04 Jan 2007 Comments
Back From Africa! 07 Aug 2006 Comments
MapChangers and Africa 07 Jul 2006 Comments
Tri For Fun 2006 22 Jun 2006 Comments
Worlds Smallest Rails Contributor 02 Jun 2006 Comments
Mark Warner 01 Jun 2006 Comments
Why Spambots, Why? 25 May 2006 Comments
UVAS Triathlon 23 May 2006 Comments
3 months in 6 minutes 14 Apr 2006 Comments
SSB Guest Post 20 Jan 2006 Comments
Our Ten Words 20 Jan 2006 Comments
Best Revolt Since Sliced Bread 13 Jan 2006 Comments
Site Update and Ashdown 20 Dec 2005 Comments
Starting a New Conversation 12 Dec 2005 Comments
Stepping Down, Endorsing Margee Ensign 04 Dec 2005 Comments
Turning Everything Inside-Out 28 Oct 2005 Comments
No More Bunny Ears 28 Oct 2005 Comments
Take our land... please! 27 Oct 2005 Comments
Culture of Corruption 27 Oct 2005 Comments
1999 and counting 25 Oct 2005 Comments
Democrat and Republican Email 24 Oct 2005 Comments
Wi-Fi Cloud Covers Rural Oregon 17 Oct 2005 Comments
Moving Forward - An American Roadmap 16 Oct 2005 Comments
A Very Special Election 12 Oct 2005 Comments
Since Sliced Bread 06 Oct 2005 Comments
Beyond Delay 28 Sep 2005 Comments
13 / 535 is not good 26 Sep 2005 Comments
Paul Rusesabagina 22 Sep 2005 Comments
I Mean Honestly... 22 Sep 2005 Comments
New Website! 19 Sep 2005 Comments
Welcome DFAers! 16 Sep 2005 Comments
New Website Testing 13 Sep 2005 Comments
Andrew Rasiej for Public Advocate 10 Sep 2005 Comments
Katrina 07 Sep 2005 Comments
$5 Gas and ANWR 02 Sep 2005 Comments
Pombo Country 31 Aug 2005 Comments
Comment Lost! 26 Aug 2005 Comments
Back from Wyoming 17 Aug 2005 Comments
On Our Way to Wyoming 06 Aug 2005 Comments
Back from Poland 28 Jul 2005 Comments
Tri For Fun 16 Jul 2005 Comments
Jessica in Europe 07 Jul 2005 Comments
Ripon Wireless – Leading the District 02 Jul 2005 Comments
Iraq Blogger Injured 24 Jun 2005 Comments
Machado and Matthews Out 23 Jun 2005 Comments
School's Out 19 Jun 2005 Comments
Send Your Mail Again! 12 Jun 2005 Comments
Podcast 11 Jun 2005 Comments
Servers and Terrorism 09 Jun 2005 Comments
Walking and Running 08 Jun 2005 Comments
Goings On 03 Jun 2005 Comments
Memorial Day 02 Jun 2005 Comments
Walking Flyers 26 May 2005 Comments
Community Captains Start 26 May 2005 Comments
MicroGoal 25 May 2005 Comments
Micro Goal Report 24 May 2005 Comments
Podcast 21 May 2005 Comments
Rasiej Stuff 19 May 2005 Comments
New Business Cards 19 May 2005 Comments
Fezzik and PDF Pictures 19 May 2005 Comments
PDF Wrapup 17 May 2005 Comments
At the Personal Democracy Forum 16 May 2005 Comments
Podcast 12 May 2005 Comments
GIS Instead of Podcast 10 May 2005 Comments
Scott the Republican 08 May 2005 Comments
FEC Packet Came Today 08 May 2005 Comments
Advocates For Rasiej 08 May 2005 Comments
OpenSourceRadio 07 May 2005 Comments
New York Trip 07 May 2005 Comments
Podcast 03 May 2005 Comments
Kitten War 03 May 2005 Comments
Another one doesn't get it 02 May 2005 Comments
Podcast 29 Apr 2005 Comments
Open Source Politics 22 Apr 2005 Comments
Podcast 19 Apr 2005 Comments
Thursday Podcast 14 Apr 2005 Comments
Phone Line Back Up 14 Apr 2005 Comments
RunForCongress.com Interview 07 Apr 2005 Comments
I'm Not Dead Yet 05 Apr 2005 Comments
Back from Yosemite, Off to Camp Wellstone 31 Mar 2005 Comments
Thursday Podcast - 24 Mar 2005 Comments
Pombo lashed on mailings 23 Mar 2005 Comments
Tuesday Podcast 22 Mar 2005 Comments
Representa-what? 19 Mar 2005 Comments
Chris LeDoux Farewell Podcast 17 Mar 2005 Comments
Chris LeDoux Comments 17 Mar 2005 Comments
Politicans who blog 15 Mar 2005 Comments
Delayed Podcast 15 Mar 2005 Comments
Drilling Offshore with Pombo 11 Mar 2005 Comments
Website Downtime 10 Mar 2005 Comments
Podcast-less Week 09 Mar 2005 Comments
Conservation Easements 09 Mar 2005 Comments
Friday Podcast 04 Mar 2005 Comments
Tuesday Podcast 01 Mar 2005 Comments
In the paper 28 Feb 2005 Comments
Thursday Podcast 24 Feb 2005 Comments
Double Digits Podcast 22 Feb 2005 Comments
Podcast 9 17 Feb 2005 Comments
Tuesday Podcast 15 Feb 2005 Comments
Valentine's Day Post 14 Feb 2005 Comments
My District 11 Feb 2005 Comments
Friday Podcast 11 Feb 2005 Comments
Podcast 6 08 Feb 2005 Comments
Podcast 5 04 Feb 2005 Comments
Retracted Podcast 02 Feb 2005 Comments
Podcatch How-To 02 Feb 2005 Comments
Podcast 4 02 Feb 2005 Comments
No Podcast Today 28 Jan 2005 Comments
Second Podcast 26 Jan 2005 Comments
First Podcast! 24 Jan 2005 Comments
Martin Luther King 19 Jan 2005 Comments
Arnolds State of the State 07 Jan 2005 Comments
Happy New Year 03 Jan 2005 Comments
Participatory Politics 18 Dec 2004 Comments
Dogbert Speaks the Truth 17 Dec 2004 Comments
Howard Dean Op-Ed 10 Dec 2004 Comments
Southeast Stockton Malnutrition 08 Dec 2004 Comments
Pombo Paying Family 07 Dec 2004 Comments
Wiki Bills 01 Dec 2004 Comments
Elections we can trust 20 Nov 2004 Comments
Running in 2006 18 Nov 2004 Comments
Fixing Democracy 08 Oct 2004 Comments
Internet Politics 06 Oct 2004 Comments
Election Stuff 05 Oct 2004 Comments