Open Source BitKeeper

There’s been a bit of talk lately about how Andrew “Tridge” Tridgell (of Samba fame) reverse engineered teh BitKeeper protocol, allowing him to make an Open Source client. He gave the keynote talk this morning at LCA, and at the end he explained what he did and what his thought process was. I’ll try to do the same. Follow along…

Firstly, find the BK repository that you’re wanting to check out. For example, the e2fsprogs documentation has details regarding the e2fsprogs project. From here we can see:

bk clone bk://thunk.org:5000

This shows a few things. Firstly, the client is called bk, you’re and you want to clone the repository found at thunk.org. The server runs on port 5000. Nothing too hard yet. Let’s telnet to 5000 and check it out.

mlambie@duke:~ $ telnet thunk.org 5000
Trying 69.25.196.29...
Connected to thunk.org.
Escape character is '^]'.

Hmm… that appears to have worked… Now what? help?

mlambie@duke:~ $ telnet thunk.org 5000
Trying 69.25.196.29...
Connected to thunk.org.
Escape character is '^]'.
help
? - print this help
abort - abort resolve
check - check repository
clone - clone the current repository
help - print this help
httpget - http get command
get - http get command
pwd - show current working directory
quit - disconnect and end conversation
rootkey - show the ChangeSet root key
status - Show status for repository
version - Show bkd version
putenv - set up environment variable
pull_part1 - pull remote changes from current repository into client repository
pull_part2 - pull remote changes from current repository into client repository
rclone_part1 - clone local repository to remote repository
rclone_part2 - clone local repository to remote repository
synckeys - sync keys in local repository to remote repository
chg_part1 - get new csets in remote repository
chg_part2 - get new csets in remote repository

Interesting… very interesting. It appears clone is a recognized command. Let’s try:

mlambie@duke:~ $ echo clone | nc thunk.org 5000 > e2fsprogs.bk

Sure enough, you’ll get a copy of the repository. You have a BK client in one line of bash. Ease up Linus.

1 Comment so far

  1. Hale on April 21st, 2005

    I’d call this a few minutes tinkering, not reverse engineering. A bit of overkill on Larrys part I think.