Patch Set 3:

Ok, here's Round 2.  I think I hit all of the style issues from before, and addressed the commonBase problem we discussed.  I did it in a slightly different way than your suggestion, but I think it makes a little bit more sense given how the data comes into the generator.  Let me know if you see any problems with it.

The generator should now return all commits up to the specified depth, ignoring any that were part of commonBase.  But it will correctly start returning any commits below the boundary of a previous shallow checkout, and return all commits at the old boundary as UNINTERESTING so that the PackWriter can exclude the right things from the pack.  As far as I can tell, this is correct behavior in all cases.

I couldn't do the SEEN thing like I was planning on doing, because uninteresting commits get the flag set on them as well (as part of markStart()), so sometimes it's already present on commits in our queue even though we haven't added all their parents yet.  I reworked the depth stuff a bit and added some comments, hopefully making it clear enough that the depth sorting accomplishes the same thing.

I'm cautiously optimistic that this is getting pretty close.  Please let me know if there's anything else that needs to be done to get this thing completely out the door.