This blog has moved to Medium

Subscribe via email

Archive for June 2011

When is git rebase better than git merge?

In Ken’s “git for gits” presentation today, I asked when is “git rebase” better than “git merge”.
I want to summarize what I think the best answer is in this post (hint: it’s not “the version tree looks simpler after a rebase”).
If I recall correctly most of the content of this post appears in some form in the Git Book, but there’s no harm in retelling it in my own words.

Suppose you’re working on a private feature branch, and master is receiving some commits as well.
If you try to merge master to your feature branch, you have to resolve all the conflicts at once. If you have a lot of them, this can be painful.

When you rebase, you are effectively reapplying your work, commit by commit, on top of the work done on master. At any point in this process, if there are conflict, you can resolve only that conflict, compile and test your work, and once you’re satisfied proceed to the next conflict. This can be indispensible when trying to do large merges (I’ve had merges that take a few hours to resolve and test … I still remember telling everyone “please don’t commit to trunk for the next few hours, I have a huge merge).

The downside is of course that you’re altering history, and if someone else cloned your repository this might mess up their work – so only do this on private branches.

The bitcoin roller coaster, and more

Wow, this was an exciting weekend.

Black Friday Sometime last week, I gave a friend some advice. “I think Bitcoin will rise 10% over the next 12 hours”, I said. I’ve been pretty good at predicting some of the recent price increases, so I got cocky and started thinking I’m actually smarter than the market. Then came the first Bitcoin Black Friday,  as value crashed down about 60% from a high of about $32 to a low of $11. In two days. Since then it bounced back to $20. I’m never giving short term financial “advice” or opinion again. In my defense, I did say Bitcoin is a long term investment, not something to use for short term gains, but I forgot just how much the market is still volatile. A good strategy for overcoming this volatility when buying or selling is splitting the action into a few days instead of buying/selling all at once. If for example you want to buy $1000 worth of Bitcoin, you should divide your purchase into a few smaller purchases. The downside is you’ll miss out if Bitcoin starts rallying up really fast, but you’ll incur much less volatility if you spread your purchases.

Bitcoin is not anonymous One interesting thing I discovered is that Bitcoin are really not anonymous, not under the current design at least. I summarized the arguments on this thread – basically, using some not too sophisticated analysis, you can guess out how much money belongs to each user you ever traded with. Not accurately, and it can be defended against, so I’m not worried, but it’s something that anyone with a few BTCs should be familiar with.

Diversifying into Namecoin Namecoin is a Bitcoin-based project designed to create a distributed name registrar (Bitcoin to Paypal like Namecoin to GoDaddy). Just for the heck of it, I’ve decided to diversify and purchase a small amount of Namecoin. It’s funny investing in an alpha stage startup project that’s based on a beta stage currency (or rather a POC that’s based on an alpha), but I’m curious enough to try it out.

MtGox just put 432,000 Bitcoin into a single address A lot of money is being moved. There are a lot of people false rumours like “Mt. Gox was raided by the Japanese authorities” and “shots fired at Mt. Gox, Bitcoin seized“. Some people have a huge investment and are trying to play with the market, play with people’s fears and make a quick buck.

A serious contender to Mt. Gox There’s a new exchange on the block. TradeHill has a better UI, and looks like it will develop partnerships with regional BTC sellers. I don’t know the exact volumes, but word on the street is that people are moving from Mt. Gox to TradeHill. The exchange is about a week or two old, and already is 3rd in term of volume (check out Bitcoin Charts). Nice work, we do need some competition to Mt. Gox, and having only one large exchange is risky.

A way to speed up your bitcoin client! I almost forgot, but here’s a way to add your Bitcoin client’s initialization. When it starts, bitcoin doesn’t know of any peers in the p2p network, so it hops into an IRC channel, announces itself periodically, and listens for other announcements. This can take some time. If you want to speed it up, simply add some fixed fallback nodes to your bitcoin command line. Yes, obviously this should move into the standard client, and it should cache known peers. We know the current client kind of sucks. This is the price we pay when the public’s interest in a project out-paces its development … the client will catch up.

The Faucet is empty Not too long ago, you could get 0.02 BTC for free from the Faucet. Well, since the rise on Bitcoin value, this is now equal to about 40 cents, and the Faucet’s pool was drained out. The solution is of course to lower the payout to something like 0.0001 BTC, but the problem is the client currently doesn’t allow transfer of amounts smaller than 0.01 BTC. This will be fixed in the upcoming version.


And last, but not least – I just read about Bitcoin in an Israel “dead wood” newspaper – Economy (כלכלה) by Maariv.

A summary of my history with source control

  • Folder-based, copy-paste VCS. Where was that stable copy again? Ah damn, we deleted it.
  • SourceSafe. Will eat up your files™
  • ClearCase. How do I merge that branch? The ClearCase admin will be here in two weeks, he’ll help you. Hopefully.
  • TFS. Only works within Visual Studio? That’s ok, we’ll just use A SEPARATE VCS to store our java files.
  • SVN. Ah, you mean I don’t need to mark a file I’m editing, only when I actually commit it? Nice. But merges are still hell, and svn update takes forever.
  • git. You mean I can switch to another branch is about 20 milliseconds, and merge in back in a second? Sweet.

The End?

Think Bitcoin is a bubble? Here is your chance to profit from it

If you’re a loyal reader of this blog, odds are you already saw some of my recent posts about Bitcoin. The reaction of the people I’ve personally discussed Bitcoin with can be largely classified into three classes:

  • Strong optimisim, usually followed by some purchase of Bitcoin
  • Indifference and lack of interest
  • A strong belief that Bitcoin is a bubble, current prices are way more than they should be, usually accompanied by smug looks and thoughts like “why is he putting his money into this fool’s gold”

Well, if you belong to the last category, you now have a chance to put your money where your mouth is. BitOption is a new website where you can buy PUT and CALL options on Bitcoin. If you’re convinced the Bitcoin bubble will indeed burst and BTC/USD will fall down, feel free to go to BitOption and risk some money on it. If you’re right, you could make a nice profit!

The bitcoin early adapter problem, and why it isn’t

Out of the many arguments people have against Bitcoin, one of the strong ones seems to be what I call “the early adopter problem”. The argument goes as follows: suppose that Bitcoin eventually does succeed and becomes a significant portion of the world’s currency or store of value. Over 6 of the eventual 21 million bitcoins have already been mined and are in the hands of a fraction of the worlds population. If bitcoin is successful, this means that too much wealth will be concentrated into the hands of too few people, who just happened to be in the right place at the right time.

There are a few reasons why this is not, in fact, a real problem:

  • Bitcoin was not designed to be a fair currency, just a more efficient currency than its alternatives. Dollars and Yens aren’t “fair” either.
  • It is not random luck that is rewarded – it is one’s ability to research and arrive at correct conclusions. In this scenario, the people that found out about bitcoin at “an early stage” and made the decsicion to either mine or buy them, are rewarded for a smart technological and economical decision – much like early investors in successful startup companies are rewarded.
  • It is not too late – in this “bitcoin wins” scenario”, the final value of bitcoin will be a few orders of magnitudes higher than its current value. If you’re reading this now and think that “it’s not fair only a few early adapters win”, you can still join us.
  • Perhaps the strongest argument IMO is the economical argument – If bitcoin “wins”, but its wealth remains concentrated in too few hands, it won’t be as useful to the rest of the world because of over-pricing and scarcity. As a result, this will be reflected in bitcoin prices, because the public will not be willing to pay the outrages amounts demanded by the early adopters – in fact, it will make bitcoin “lose a little bit”, or not reach its full potential. In turn, this will motivate said early adopters to sell some of their stash (nobody likes to be on a losing horse), thus moving bitcoin to other parts of the population. Once the market believes this is no longer a problem, the price of bitcoin may rise to its “real” and full value. In shorts, the market will auto-correct any such problem.