Re: Start handling references internally as a sorted in-memory list
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Sep 11, 2006, 23:50 UTC
- Message-ID
- <Pine.LNX.4.64.0609111647000.27779@g5.osdl.org>
- In-Reply-To
- <Pine.LNX.4.64.0609111632050.27779@g5.osdl.org>
On Mon, 11 Sep 2006, Linus Torvalds wrote:
Show 6 quoted lines
> > And yeah, I know that the "sorting" code is O(n**2) thanks to doing an > insertion sort into a simple linked list. Tough. I didn't care enough to > do it well. With "n" usually being a few hundred at most, we really don't > care, and if we ever do, we _can_ fix it later on to use a heap or > something.
Btw, to expand on that - one of the nice things from this whole re-org of how we handle refs is that when you do
git-rev-parse --all
it now sorts them in a reliable order - by name. Before, they came out in some random order that totally depended on the filesystem that the references were on.
Use the "--symbolic --all" to see this in a more obvious way, before and after.
Linus