Bugs Everywhere

Bugs Everywhere is a neat piece of software implementing distributed bugtracking: it combines a bugtracker and a distributed version control system. I’ve offered to be its new maintainer, taking over from its original author of Aaron Bentley and the folks at Panoramic Feedback. Bugs Everywhere posits that the use of a centralized bugtracker for software is no less inappropriate than the use of a centralized version control system1, and that real programmers work with bugs that exist in complex states of being fixed on some branches, as yet unmerged on others, and trying to keep a mental model of which is which is doomed to failure.

For example, at OLPC we believe in cheap and fast branching, and we have feature branches (e.g. “faster”), development branches (“joyride”), release branches (“update.1”), and production branches (“candidate”, “release”). We have a bugtracker that allows us to describe bugs as being “open” or as being “resolved”, which closes them. This is not cool.

In the Bugs Everywhere world, the same branch that contains your code also contains the bug state for that code. So, as I create my “faster” branch software, I can create/close bugs linked to those commits. When my tree is merged into the next branch up, we not only get the code merged, but the bug state merged as a side-effect. The bug state is not going to become inconsistent with the code.

How does it work? We insert a .be directory into your repo, and use a command-line interface (“be”), web interface (written in TurboGears) or GUI (written in wxWidgets) to let you perform the dual operation of changing the state of the text files that describe bugs, and committing that change to the underlying VCS. We support Arch, Bazaar, GIT, Mercurial and RCS. BE itself is written in Python. Of course, another benefit of this approach is that the same offline editing advantages that your dVCS gives you apply to your bugtracker.

You might argue that being distributed sounds good, but having a common place for developers and users to go to to query bug state is important too. Having a distributed bug tracker isn’t incompatible with this — the central web interface to the bugtracker becomes just another client performing merges with the master location for the repository.

So, should you drop everything and switch to BE? Well, maybe. One way in which BE currently isn’t suited to OLPC is that we like having a central bugtracker for many projects, even though each project has its own source repository, or even several. BE would be much more suitable if we were just developing a single software project, rather than the complex selection of projects and processes that we currently track. Maybe the way forward is to run a meta-tracker that keeps track of changes in any of the specified source repositories and collates them.

Another current limitation is the web interface support, which was written against an old version of TurboGears, and is still a proof of concept. Noah Kantrowitz is interested in working on a BE backend for Trac, which would offload the web interface awesomeness to Trac.

I’m writing this post to try and build up a community around BE: please check out our wiki and mailing list, and consider hacking on it. It’s the future, honest.

1: Or at least, I do.

Transcript of Lawrence Lessig Obama video.

Lawrence Lessig has posted a video on why he is for Barack Obama. SJ Klein, Madeleine Price Ball and I just finished transcribing it. Lessig’s video, and our transcription, are available under the Creative Commons Attribution 3.0 license.

“A request”

I received a strange request from someone I didn’t know in my inbox the other day — a letter asking me to make a video “enumerating why I support Barack Obama”. As Julie Cohen wrote, “Many of my smartest friends have been recently leaning towards Clinton” and that, she said, was because “I believe that his speeches are not detailed enough regarding his policy strengths” and she concluded “now is the right time for you to make a video, I know you can change a lot of minds.”

Well I doubt I can change a lot of minds, Julie Cohen, but I do agree with you that this is an extraordinarily important election.

But it’s important not because of the details about Barack Obama’s policy strengths. I believe his policies are strong, especially the policies I know something in particular about — his technology policies are extremely strong. But policy differences between these two candidates are actually quite small. As the New York Times said in their editorial endorsing Hillary Clinton, “On the major issues there is no real gulf separating the two.”

So in policy alone I’m not sure that there’s any good reason to prefer the one over the other. Yet I still think it extraordinarily important that one win over the other: namely Barack over Hillary Clinton. For what’s at stake here, I think, is something much more important than the particulars of some laundry list of policy disagreements that there might be between them.

So what is that something important — why should one support Barack over Hillary?

Well I think there are three factors to consider here: character, integrity, and what each candidate would do.

So let’s start with character. In particular I’m thinking about a certain kind of moral courage. The question of whether the candidate is calculating in the face of right, or whether in the face of knowing what’s right or consistent with his or her principles, he or she chooses that answer regardless of the consequences.

So for example, one feature of this man’s presidency (Bill Clinton), a man I supported for president (and think he did an extraordinary job as president), but one feature (or let’s say bug) was his consistent refusal to stand up for for what were strong principles, at least as he articulated them, in his campaign. So for example within a couple weeks of coming into office he had given up a commitment to let gays serve openly in the military. It was expedience that led him to that result rather than standing and fighting on the basis of principle.

Now, the question is whether Hillary is like Bill in this respect. And I think to be fair we have to say you can’t really know, we haven’t seen enough. There are things to make one suspect that she lets principle yield in the face of expedience.

So, for issues as small as whether she would call for presidential debates to be left free so that people could download them and remix them without fearing copyright restrictions, Hillary — unlike Barack and John Edwards and others even on the Republican side of the debate — refused to endorse this call, fearing, perhaps, that it would alienate some of her strong pro-copyright interests in the Democratic party.

To issues as large as Iraq, where here the decision she made was the wrong choice. But she made that choice in the face of overwhelming political pressure to go along with the president. Now maybe she didn’t know it was the wrong choice, maybe she actually believed what she did was right; though it’s important to remember that among the Democrats not facing re-election at the time of this war, a majority opposed the war. And for senators running for president — therefore susceptible to this political pressure more than anybody — all but one endorsed the war, including John Edwards.

So while we can’t know about this feature of her character, I think all of us remember believing that when she voted in favor of the war at that time, rather than taking a strong and principled view that a majority of the Democrats not facing re-election did, it was an expression or sign of a certain kind of weakness that reminded many of us too much of the presidency of her husband.

This is the moral character — or lack of moral character, moral courage — that I fear most about this candidate.

Now, in this respect I think Barack Obama is exactly the opposite. There’s one clear example of this all of us know, that’s the example of Iraq. And we have to remember here just how hard this was. We have to remember the insanity of us, or of the United States, at this time. In October 2002, as the drumbeats for war were increasing, Barack Obama took to the streets of Chicago and made a strong call to stop the entry into this war. As he said:

I stand before you as someone not opposed to all war in all circumstances. I don’t oppose all wars. What I’m opposed to is a dumb war, what I am opposed to is a rash war. A war based not on reason, but on passion; not on principle, but on politics.

That was precisely the right description of the war that led us to Iraq, and this was not a popular position for a candidate for the United States Senate to take, especially in a State that had a Republican governor. Yet Barack Obama took this position. And in this one respect at least, it shows that he has a certain kind of moral courage. Not because he was smarter, not because he had access to better intelligence about Osama bin Laden, but because he had the moral courage to stand up for what was right in the face of very strong political opposition.

This is one clear example — perhaps the most important moral and political judgement of the last thirty years, signalling he is much less likely to make the same kind of cowering mistake again. That’s character.

Think now a little bit about integrity. When I think about the worst in politics in the last fifteen years there are two features that stand out for me. One is the lack of moral courage, of again candidates and presidents like Bill Clinton, and second, a lack of political decency, in particular around the elections that got this man (Bush) into office orchestrated by this extraordinary figure, Karl Rove. Think about Karl Rove’s tactics in South Carolina, where he made racial suggestions through push-polling that drove many Republicans away from John McCain, probably costing McCain the election. Suggestions that were false and were extraordinarily unfair to make, and that were made for the purpose of defeating the opponent.

Or think about the swiftboating of John Kerry, by taking his strongest character — the fact that he alone of all the candidates had voluntarily gone to war to defend the interest of his country — an unpopular war, while the President and the Vice-President found a way to escape that war. What Rove did was to find a way to take this strong feature and make it a target of an attack, by suggesting false and misleading facts about his service in Vietnam, to weaken this feature of his character: that’s swiftboating.

I remember when watching these things happen, thinking to myself “How in America can these sort of techniques win?”. Yet the worst in this campaign, was to watch this kind of Rovian Republicanism become Rovian Democrats. Think for example about the issues around the war: Hillary Clinton and Bill Clinton have launched an attack on Barack Obama, claiming he has been “inconsistent” about the war. Here’s what she said in one of the debates:

It was after having given that speech, by the next year the speech was off your website. By the next year, you were telling reporters that you agreed with the president in his conduct of the war. And by the next year, when you were in the Senate, you were voting to fund the war time after time after time.

Now as Hillary Clinton knows, this statement is both false and misleading. It’s false because in fact, the speech that she says was removed from Obama’s website remained on Obama’s website throughout the course of the next year. You can know that by going to this site, The Archive org’s Wayback Machine, and you can actually see copies of the web taken in every couple of month intervals from 1996 on. And here’s a copy of the Barack Obama website — we have to decode it a bit by looking at the very top line — this is a copy of February of 2003, there’s Obama’s speech.

Here’s a copy taken in April of 2003, there again is Obama’s speech. June, it’s still there… August, it’s still there… October, it’s still there. It was there the whole year. And even after that year Barack continued to lead his Foreign Policy section by describing his strong and consistent and principled opposition to George Bush’s decision to take us to war.

But the charge is also misleading, because there’s no inconsistency with opposing the war and actually supporting funding for the war once it has been launched or supporting funding for our troops once they are there. Think about Howard Dean, who was the strongest candidate in the 2004 election opposing the war: he absolutely and clearly signalled that even though he opposed the war he would not cut off funding for the troops or withdraw them immediately if he became President.

This is a kind of swiftboating — it takes the strongest feature of Barack’s political character here, the fact that he made the right decision about the war, and tries to weaken it by alleging false and misleading facts about that decision.

Or think about the brou-ha-ha around Ronald Reagan. At a Nevada editorial event, Barack said this about Ronald Reagan:

I mean, I think Ronald Reagan changed the trajectory of America, in a way that, you know, Richard Nixon did not and in a way that Bill Clinton did not. He put us on a fundamentally different path, because the country was ready for it.

And then a little later he said:

And the Republican approach, I think, has played itself out. I think it’s fair to say that the Republican party was the party of ideas for a pretty long chunk of time there over the last ten, fifteen years, in the sense that they were challenging the conventional wisdom.

This statement says two things:

  • a), that Reagan was a transformational president;
  • and b), that the Republicans were a party of ideas.

Both statements are obviously true.

What Barack did not say, however, was a) that he agreed with Ronald Reagan’s views, or that only the Republicans had ideas. And here’s how that statement was used by Hillary Clinton in the debate at Myrtle Beach just before the South Carolina primary:

She said, quote:

He has said in the last week that he really liked the ideas of the Republicans over the last ten to fifteen years.

Now you saw what he said, and you can see that what she says here is just plainly false; Rovian in its character. But finally, consider this issue around the question of a woman’s right to choose whether to terminate a pregnancy or not. Hillary Clinton and her campaign have campaigned on the idea that Barack Obama is weak on “choice”. In mailings in both Iowa and New Hampshire she has claimed he’s weak on choice, and in public speeches to women, and young women in particular, that he is weak on choice.

Lorna Brett Howard was a supporter of Hillary Clinton, a former president of the ChicagoNow! organization. But she was so outraged by what she called the “false statements” about Barack’s campaign that she made this video, now appearing on YouTube where she asserts first that 100% ratings were received by Barack Obama during his time as Senator in the Illinois State Senate; and that the fact the he supported women’s rights had never been questioned, including the right to choose.

Here the campaign — the Hillary Clinton campaign — is totally ignoring the truth, and this time, ignoring the truth with a certain important consequence, as Lorna Brett Howard said:

And this line of attack on an issue that I care about so deeply is not acceptable to me.

And because it wasn’t acceptable, she publicly switched her support from Hillary Clinton to Barack Obama, switched her support because she had been using — Hillary Clinton had been using — the kind of techniques that we Democrats thought were only at the level of Republicans.

This is a measure of a certain kind of integrity, an integrity that I think we should all demand that the political process reveal.

Now people will say in response to this “Oh, that’s so naive. This is the way that politics is. All politics is like this. You can’t punish one candidate because they’re using the style of politics.”

But this is the way all politics will be only if we reward the behavior of people that employ this Rovian style of political behavior. We will get more of it if this is the kind of behavior we reward, and that’s a good reason, following Lorna, for people who support Hillary Clinton to either criticize this behavior of her campaign or to switch support to Barack Obama.

But finally, most important is the distinction between the two candidates about what they will do. But to see this we have to think about what we expect this election to be about. The rhetoric around this election is focused on “change”. But what is this idea of change? What do the candidates mean by it? Here’s what Hillary Clinton said in one of the debates:

Well, let me say first, that I think we’re all advocating for change; we all want to change the status quo, which is George Bush and the Republican domination of Washington for so many years.

When I heard that, I thought to myself “Is that really all we’re trying to achieve in this election, to get the Republicans out of office?”. Because as I heard candidates like Edwards and Obama, I heard a call for a change much more fundamental. A change in how Washington runs; a change in the power of money or corruption in how Washington runs. A change in the very core of the system that has produced the results that have slowed responses to global warming or slowed the adoption of healthcare. Edwards and Obama have evinced their support for this strong version of change by refusing to take any money from lobbyists or PACs: their target, at least as they see it, is fundamental reform of the system.

Hillary Clinton, here, is very different. Here is a speech she gave at the yearly Kos convention last summer:

“Senator Edwards has really a very straightforward question here, which is will you continue to take money from lobbyists or will you take his position…”

“Yes I will. I will, because you know a lot of those lobbyists, whether you like it or not… represent real Americans.”

No-one doubts that the lobbyists represent real Americans; though of course they also represent lots of foreign entities as well. But the question is not who they represent, the question is whether their influence represents — mis-represents — solutions for America. Whether the effort they have and the power they have in controlling the agenda and access to members of Congress shifts the way Congress responds to the issues. But it’s very clear given what she said, that when she speaks about change she speaks of a different kind of change; not the real change that Barack Obama puts at the center of his objective for a new administration. But there’s a second kind of change that I think is actually much more important than this change in how Washington works. This is a change for peace.

We have to understand of course that the presidency has become something very different from an accountant or CEO of the Government. The presidency is a leader, a leader who inspires moral courage, who inspires us to be something different, to transform us, and inspires the world in how the world sees us.

Here I think there is no comparison betwen these candidates. Hillary Clinton is good enough, she’s a good enough speaker, she’s very powerful and responsive, she’s a great debater. But in this debate, Barack Obama is just off the charts. Remember his intervention at the Democratic Convention in 2004:

“Tonight is a particular honor for me because, let’s face it, my presence on this stage is pretty unlikely. My father was a foreign student, born and raised in a small village in Kenya. he grew up…”

And then, on his campaign too:

“There’s no such thing as false hopes. But what I know deep in my heart is that, we cannot bring about change unless we are unified. Unless we do it together. Change does not happen from the top down, in America or anywhere else. It happens from the bottom up!

This is a man who will inspire as he leads. He will inspire all of us, across racial lines, and gender lines, across class lines, across age. He will inspire us because he can capture, in a way that very few presidents in the last hundred years have been able to capture, the imagination of a generation.

But there’s one more crucial way in which Barack Obama can inspire, distinct from how Hillary Clinton could ever hope to inspire, and that’s the inspiration he would offer towards peace. We in this country need to acknowledge to the world a certain mistake that most of us understand we made. At the height of insanity, after this extraordinary and horrible bombing, of our own citizens on our own territory, we were led into war by a president who didn’t care to pay attention to the facts.

This was the biggest political blunder, perhaps ever, that an American president engaged. It was extraordinarily destructive — destructive to us and to them. If we’re going to find peace here, then that peace will only come if we can signal our own change. A change that they understand is a change in who we are, a change that they can see.

So I want you to shut your eyes and imagine what it will seem like to a young man in Iraq or in Iran, who wakes up on January 21st, 2009, and sees the picture of this man as the president of the United States. A man who opposed the war at the beginning, a man who worked his way up from almost nothing, a man who came from a mother and a father of mixed cultures and mixed societies, who came from a broken home to overcome all of that to become the leader in his class, at the Harvard Law Review, and an extraordinary success as a politician. How can they see us when they see us as having chosen this man as our president?

There can be no clearer way that we could say, that we could say that the United States could say, that we have changed, than by electing this man. There is no way we could more clearly move on toward peace than this. He represents the very best of who we are, the best of character, of integrity and ideals. And someone who opposed the war from the start.

So Julie Cohen, here is my request: I agree with you nothing could be more important than this election and this candidate; but nothing could be more important also than solving this impossible war; not just by bringing the troops home, but also by enabling the peace. By enabling that peace, by beginning a process of forgiveness and of hope. That is the great hope that this new generation, represented in this leader, Barack Obama, gives us. And gives the world.

Credits

Flickr photos, cc-licensed : Joe Grimmings Photography (Obama, Clinton, boy [holding an Obama sign]), Ficusrock (Kerry), Wigwam Jones (McCain), matthewbradley (Rove), sskennel (Clinton).

Fun with graphics drivers

It all started, as most things in the universe have, with a slight popping noise and a bad smell.

One of my coworkers sent me a message last weekend, while I was at home, pointing out that my desktop machine at work smelled like it was burning. After discussing the merits of turning off computers emitting burning smells before chatting with their owners about it, we had a look inside and found this:

The leftmost set of capacitors is fine, the set to the left of the fan is not. It’s actually a very well-controlled demolition; an electrolytic capacitor has boiled and blown out the top of its cap, which is perforated to enable exactly this failure method, and then once one cap is gone the rest are obliged to follow suit ‘cause the current on them increases in response. So, anyway, this left me in the market for a new graphics card.

The card in the picture is an nVidia 7300, which I bought two years ago because it was the only cheap card that could handle the dual-link DVI required for my 30” display with free drivers. Two months ago, though, Dave Airlie committed support for dual-link TMDS on ATI Avivo cards. These cards had historically been the worst of the worst for drivers—the free drivers were left nowhere without any specifications, and even the ATI binary driver for Linux took a long time to add support. Thanks largely to AMD’s latest NDA-less specification drops, though, we’re well on the way to a free accelerated driver for these cards, so I bought a X1600+ from buy.com.

When I booted X on it with the radeon driver, though, it looked craptastic. Since I like hacking on drivers, and since I didn’t have much of a choice, I thought I’d try to figure out what the problem was. The rest of this post is about what I tried during the subsequent bonding exercise between me and the registers on my new graphics card.

First, I asked around on IRC, and learned that it isn’t a known problem and that obtaining a register dump might be a good idea. You can get the “avivotool” that does this:

git clone git://people.freedesktop.org/~airlied/radeontool
git checkout -b avivo origin/avivo

I made the register dumps, but nothing was standing out. Then I lucked out: I tried the fglrx (proprietary) driver to see whether the problem happened there—it didn’t, and furthermore it didn’t happen on the radeon driver after fglrx had run. This suggests that fglrx is setting useful registers that radeon doesn’t even know enough about to reset when it starts.

The next step is to diff register dumps with broken-radeon and post-fglrx working-radeon. This got >100 differently-set registers. Dave Airlie gave me a basic explanation of the register layout: under 0×1000 and over 0×6000 are setup, and the rest are mostly the 2D acceleration space.

Manually setting the <0x1000 space to the working values didn’t come up with anything, though, and trying every register by hand was getting tedious. I wrote a perl script that takes two register dumps, assumes one is “good” and one “bad”, and offers to set each differently-set register to the “good” state, pausing for a second for you to inspect the screen output for a fix inbetween each.

And, eventually, it got it right—0×6590 (which radeon_reg.h knows to be AVIVO_D1SCL_SCALER_ENABLE ) and 0×6594 are both set when the card boots, but unset by the fglrx driver, and unsetting them while running radeon results in a fixed screen image. We can do this simply in the driver:

OUTREG(0x6590, 0);
OUTREG(0x6594, 0);

At this point, Alex Deucher (who works at AMD/ATI on open-source driver development—awesome!) stepped in and explained that the scaler code doesn’t work yet, and the driver should really turn it off when it isn’t being asked for. So now we do.

Here’s a photo of the working result. Planet Emacsers will be pleased to see a ridiculous amount of emacs in it.

Tracing internal function calls in a binary

Dear everyone who likes Unix,

I have a binary (which uses glib and was compiled from C) and I’d like to get output with the function name each time any function in that binary is called. So, I’d like the output of ltrace(1), but for function calls rather than dynamic library calls. I am bored of adding g_debug("%s", G_STRFUNC); to the top of all my functions.

You’d think this would be easy, given that incredibly similar tools have existed for twenty years, but so far the shortest answer I’ve heard starts “well, you could write a gcc profile function stub that..”. It would be nice not have to recompile, since gdb certainly doesn’t have to, but I’d welcome the way to achieve this with a recompile as well.

Any ideas? Thanks!

Update: jmbr wins, with the only solution that doesn’t require anything more than gdb, and no recompile. Here’s his script: http://superadditive.com/software/callgraph. I’d like to work on it to add support for modules loaded with dlopen().

Spherical cows

Madeleine just started up a webcomic site — everyone should go over to Tipping The Spherical Cow and leave her comments telling her to keep going with it.

We had a tofu turkey for Thanksgiving this year, for the first time. The visible seams were a little disturbing, and it was not entirely tasty though not bad when cold. The dog managed to pull it off the counter the next morning and ate all of the rest of it, which at least saved us from Tofurkey sandwiches for the next week. Here’s a photo:

Mass production

I spent a week (my first time in Asia) in Changshu, China the week before last, in preparation for this:



Congratulations to everyone involved with OLPC. You’re all heroes.

Suzhou

I’ve been in China for the last week, at the Quanta factory in Changshu (an hour west of Shanghai) where we’re gearing up for production of lots of XO laptops. It’s my first time in Asia. There is more neon than I expected, considering we aren’t even in Shanghai:

Today we awarded ourselves a (half) day off and headed to the tourist center of Suzhou, which is the province that Changshu is in. It has many famous gardens (including a UNESCO World Heritage site) and a silk industry that dates back a millennium.

Suzhou Museum’s newest buildings were designed by I. M. Pei, an architect who also designed the MIT Media Lab building. He’s from Suzhou, and came back after a long career to design the museum for them. Here’s a photo from the entrance, and then one of the Humble Administrator’s Garden:

I’m headed back to Boston tomorrow. Go Sox!

Productivity, a year on.

It’s been a year and a half since I wrote a blog post about
productivity tools — I mentioned some of the shell and editor tools I use, and it was fun and people gave me useful comments. Here’s another post, with some new lessons learned.

Emacs

python-mode flymake

Flymake is mostly the reason I’m writing this blog post. It does incremental compiling/code checking for emacs — when you make a source code change, it passes your input to an external program, and then shows (by highlighting lines in different colours) where the external program thinks that warnings or errors are.

I use it with Python, and pylint: after a code change, pylint is run on the buffer, and emacs parses the output and shows a display like the following:

This seems like a basic thing to do, but it’s making me enjoy programming more than I ever have. My Python code almost always runs correctly first time now, as I wait for the pylint warnings to go away before trying it, and I get cheered up (and, frankly, shocked!) every time I write another fifty lines of code and it works straight away. I totally recommend it. The setup’s documented on emacswiki.

find-tag-at-point

I often work on the kernel or Xorg, and I would be totally ridiculously lost with both if I wasn’t using “tags” support in my editor. Here’s how it works: you run etags over your .[ch] files (or make tags in
a kernel source dir), and it generates a TAGS index. You load that in emacs with M-x visit-tags-table, and with the below keybinding, pressing F10 will take you to the original definition of whichever symbol the cursor is on, no matter where it appears in the source tree.
Within a few presses of F10, you’ve escaped macro hell and found where the code that actually defines the function you’re interested in is.

(defun find-tag-at-point ()
  "*Find tag whose name contains TAGNAME.
  Identical to `find-tag' but does not prompt for
  tag when called interactively;  instead, uses
  tag around or before point."
    (interactive)
      (find-tag (if current-prefix-arg
                    (find-tag-tag "Find tag: "))
                (find-tag (find-tag-default))))

(global-set-key [f10] 'find-tag-at-point)

git.el

Also, there’s fairly good GIT support in emacs, which mostly consists of turning each GIT shell script into an emacs command you can run with M-x. I use this, but it’s not particularly exciting.

M-x gdb

emacs22 has a new graphical GDB mode. It is awesome. Here’s a screenshot from Phil Sung.

org-mode

I’m trying to get the hang of emacs org-mode, but I’m not quite there yet. I mostly want something to manage my TODOs that don’t have hard deadlines and my diary/appointment entries that do. If anyone feels like bragging about their great org-mode setup and sharing code, go right ahead.

GIT

All of the hosted projects at OLPC use GIT, for better or worse. I thought it was for worse for a while, especially when GIT 1.4 came out and made me hate branches all over again, but there are a few new features that are making me like GIT more:

git rebase –interactive

Pierre Habouzit has already written plenty about this. Solves the “wait how do I revert this one commit I made twenty commits ago” problem, and some other ones too.

git stash

git stash lets you temporarily store changes away while you get your tree in a different state; examples are in the man page.

git add –interactive

“Anonymous” commented on this post:

Don’t forget `git add –interactive` (in newer git). It allows you to commit only certain hunks of a patch.

Misc

iprint/i

While working on a kernel driver, I was wishing for a way to take a hex number (that represented a bitfield) and print its binary decoding without having to do so in my head. The command /usr/bin/i (available as iprint in Debian/Ubuntu) does this. For example:

pullcord:cjb~ % i 0x4F
79 0x4F 0117 0b1001111 'O'

(The order there is: decimal, hex, octal, bitstring, ASCII.)

Even though this solves my problem well, I’d still like the kernel printk() to get a formatting string for “binary string” itself. I wonder if a patch would be accepted.

rpmbuild –short-circuit

I’m used to Debian’s make-kpkg, which lets you hack on a kernel source tree and then build a package out of it. rpmbuild instead wants you to supply a tarball and patches for a source tree for it to unpack, patch and build with all at once. You can get around that with the --short-circuit option, which skips steps before the one you’re after. So, rpmbuild --short-circuit -bc goes through the build and install phases, skipping the prep stage.

zsh share_history

setopt share_history lets each of my shells use the same history file, and the file is updated after every command is run, so I no longer have to flick through each shell window wondering which one in particular contains the shell with a copy of the long command I ran
in its history.

A nice Free Software experience

Meike asks us for our nice experiences with Free Software developers. Here’s one of mine.

I needed to find a new RSS reader. I have a somewhat lengthy subway commute to work each day, and I like listening to podcasts or reading PDFs on the OLPC laptop. I also have a pretty busy RSS feed list, and thought it’d be nice to merge my daily RSS read with my daily commute. The RSS reader I was using (Sage, a Firefox plugin) doesn’t allow that, though, since there’s no way to have it download all new feeds and present them on a single static HTML page for offline reading.

Google Reader was an obvious choice, but I try to use web services that run on Free Software when I can. Google brought me to GobbleRSS, which is a Google Reader clone with sync capabilities.

I tried installing it on my Xen host, which runs Debian/sarge. It didn’t work; I got a PHP syntax error. I sent mail to the maintainer, Guillaume Boudreau, and went to bed. I had a reply waiting when I woke up, telling me that he’d just committed what he thought was a fix to my problem. Over the next seven hours, we sent twelve e-mails between us, with him (and occasionally me) proposing fixes. It turned out that he was using PHP 5 and MySQL 4.1, and I was using PHP 4 and MySQL 4.0. By the end of the day, he had full support for the older versions of each committed.

Thanks, Guillaume! Here’s a photo of what my daily commute looks like now:

On middle names

Dear esteemed colleague!

People with the middle name “Wormsbecker” shouldn’t tell Christopher James Ball that his middle name is “weird”.

Love,

Chris.