Words in Boxes

Nouns, verbs, and occasionally adjectives.

Saturday, August 17, 2013

What I’ve Been Reading, 18-month Edition

History

  1. Robert A. Caro, The Power Broker. A great, highly detailed book, even epic, book about Robert Moses and city government.

  2. John Darwin, Unfinished Empire: The Global Expansion of Britain.

  3. Antony Beevor, The Second World War. Comprehensive history of the second world war. The one book to read about WWII.

  4. Paul Kennedy, Engineers of Victory: The Problem Solvers Who Turned the Tide in the Second World War. A look at the logistical and engineering challenges behind the WWII.

  5. Ian W. Toll, Pacific Crucible: War at Sea in the Pacific, 1941–1942. From Pearl Harbor to Midway, how the unready US Navy learned how to fight:

    The interior of the Enterprise was a warren of metallic corridors connected by hatches, lit with harsh electric overhead lights and lined with cables, air ducts, and piping. Before December 7, most of those internal spaces had been painted white or gray, but now that the Japanese attack had dramatized the flammability of paint, working parties were put to the tedious work of chipping it all away, inch by square inch, with iron scrapers. They tore up the linoleum tiles and scraped smooth the steel underneath. They worked in the sweltering, airless heat— exacerbated by the wartime requirement of keeping the watertight doors and hatches dogged down— and found that they sweated through their uniforms so quickly they might as well strip them off and work in their underwear. It was brutal, hateful, thankless work—“ a labor of the damned,” one wrote.

  6. Greg Woolf, Rome: An Empire’s Story.

  7. Jonathan Steinberg, Bismark: A Life. Only read the first third - too dull even for me.

Fiction

  1. Adam Johnson, The Orphan Master’s Son. By far the best book I’ve read this year, and deserved winner of the Tournament of Books.

  2. Gillian Flynn, Gone Girl. A solid page turner. Also from the ToB.

  3. John Green, The Fault in Our Stars. A very good YA novel that I only picked up because of its strong showing in the ToB.

  4. Iain M. Banks - Culture novels: Consider Phlebas, Use of Weapons, The Hydrogen Sonata, and The Player of Games. I had only recently heard of Iain M. Banks and the Culture novels. I started with Consider Phlebas, which is by far the weakest. Banks lets his tendency toward grotesquery for its own sake get away from him. If I hadn’t heard such universally great things about the rest, I would have stopped. I’m glad I didn’t. The Player of Games is excellent, and The Hydrogen Sonata is solid as well. I did not care for Use of Weapons - I couldn’t buy into the central conceit or the protagonist.

  5. John Scalzi - The Ghost Brigades, The Last Colony, Zoe’s Tale. Quick, easy, and disposable science-fiction reads. Zoe’s Tale is especially forgettable - it’s a straight (and weak) retelling of The Last Colony, with only a few new scenes.

  6. James Clavell, Shogun.

  7. Frank Herbert, Dune. I finally read the classic. It’s earned its reputation.

  8. Stephen L. Carter, The Impeachment of Abraham Lincoln. Despite the good press, I couldn’t get into it and stopped about a quarter of the way through.

  9. Vernor Vinge, Rainbows End. Strangely relevant given the recent revelations about the NSA.

  10. Audur Ava Olafsdottir, The Greenhouse.

  11. Kim Stanley Robinson, 2312. As a big fan of the Red Mars series, I was excited to read this sort-of-sequel. But the book coyly (and disappointingly) refuses to mention anything directly about them. Forgettable and poorly constructed.

Thursday, March 22, 2012

What I’ve Been Reading

  1. Haruki Murakami, 1Q84. Entertaining even at 900+ pages. Top seed (and my favorite) in this year’s Tournament of Books.

  2. George Dyson, Turing’s Cathedral: The Origins of the Digital Universe. I’m listening to the audiobook during late-night baby calming sessions, which is a new experience for me (on both counts, I suppose). Still in progress, but good so far.

  3. Sara Wheeler, Cherry: A Life of Apsley Cherry-Garrard. Continuing my Heroic-Age-of-Antarctic-Exploration reading, this is a biography of the youngest member of Scott’s last expedition and the author of The Worst Journey in the World. Interesting, but not worth your time unless you’re into this stuff.

  4. Neal Stephenson, Reamde. Great but long page-turner. You can tell he had fun writing this one. Recommended.

  5. Michael S. Malone, Infinite Loop. I picked it up after hearing John Siracusa’s recommendation. It’s a detailed history of Apple from founding to 1998. Since it ends right as Jobs introduces the iMac, it’s an interesting perspective - for example it takes for granted that Apple should have allowed clones to use MacOS. Out of print, but you can probably find it at your library.

  6. Vernor Vinge, Children of the Sky. The long-awaited sequel to the A Fire Upon the Deep. Vinge is one of the most imaginative science-fiction writers at creating and depicting alien species. Recommended if you’re into sci-fi (as are the two previous novels - ignore the heinous covers).

Sunday, February 05, 2012

Migrating repositories from Bitbucket to Github

A few years ago, I decided to use Mercurial & Bitbucket instead of Git & Github for my public repositories, because Mercurial seemed simpler and worked better on Windows. But times have changed. I use OS X now, and Github has become both overwhelmingly better and more popular. So it’s time to pick up and move.

This is a guide on how to do just that. It assumes that your repos have a small number of committers, and that you’re comfortable with the command line.

1. Clean up your Mercurial repository

Chances are your Bitbucket and Github usernames are not the same. Or if you’re like me, you didn’t keep your ~/.hgrc settings the same across machines, so your commit usernames aren’t consistent even if they’re all actually yours. The migration is a chance to tidy up.

To do this, we can use Mercurial’s convert extension, which can create a new, ‘filtered’ repository from an existing repository. In our case, we’ll alter the usernames to match what we want to appear on Github.

The convert extension is enabled by adding these lines to our ~/.hgrc:

[extensions]
hgext.convert=

Next, we’ll create a text file that maps old usernames to our new usernames. This is easy with some bash magic. Go to your repository directory and on the command line type:

hg log | grep user: | sort | uniq | sed ’s/user: *//‘ > users.txt

users.txt contains a sorted and filtered list of all the usernames attached to commits, like this:

username
username@localhost
username <username@gmail.com>

Edit this file so it maps old usernames to new usernames. If you have any existing Github repositories, I recommend running git logto get the exact username / email pair Github expects.

username=Username Fullname <username@gmail.com>
username@localhost=Username Fullname <username@gmail.com>
username <username@gmail.com>=Username Fullname <username@gmail.com>

We’re ready to convert (replace SOURCE_HG_REPO and CLEAN_HG_REPO with real directory names, of course):

cd ..
hg convert --authors SOURCE_HG_REPO/users.txt SOURCE_HG_REPO CLEAN_HG_REPO

And bam, you have a new, tidied mercurial repository in CLEAN_HG_REPO.

2. Convert the repository to Git

Converting a repository from Mercurial to Git is simple. We’ll use a script called fast-export. The following instructions are adapted from Dan Benjamin’s.

The easiest way to get fast-export is to clone it from its Git repository:

cd ~/tmp
git clone git://repo.or.cz/fast-export.git 

Now we’ll create a new, empty Git repository, and use fast-export to populate it.

git init DEST_GIT_REPO
cd DEST_GIT_REPO
~/tmp/fast-export/hg-fast-export.sh -r CLEAN_HG_REPO
git checkout HEAD

And bam, you have a new Git repository, complete with your entire commit history. Don’t forget: you’ll need to convert your .hgignore into .gitignore.

3. Push the new repository to Github

Now it’s time take your shiny new Git repository and slap it up on Github. Go to your Github profile page, and click “New Repository.” Fill out the form, and follow the instructions to import an existing Git repo, which goes something like this:

cd DEST_GIT_REPO
git remote add origin git@github.com:username/REPO_NAME.git
git push -u origin master

4. Don’t forget to migrate other data

I haven’t found a way to automatically migrate them, but don’t forget about:

  • Issues
  • Wiki. I tended to use a one-page Wiki as a landing page. The Github convention is to use a readme.md markdown document. You’ll have to convert the Wiki markup to Markdown.

5. Deleting your Bitbucket repository

On the “Admin” tab of your Bitbucket repository page, you can choose to delete the repository. Make sure to enter the url of your new Github repository in the “Redirect to” field!

I'm James Sulak, a software developer in Houston, Texas.

You can also find me on Twitter, or if you're curious, on my old-fashioned home page. If you want to contact me directly, you can e-mail comments@wordsinboxes.com.