From: Junio C Hamano Date: Mon, 19 Mar 2007 05:42:27 GMT Subject: Re: Why are ref_lists sorted? Message-ID: <7vd535lrgc.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <20070319053331.GA22534@spearce.org> "Shawn O. Pearce" writes: > We already have the ISPACKED flag in the flags field to tell us if > the ref is loose or not. When inserting a ref into the hash table > you keep the loose version (either if its in the table, or the one > being inserted). As long as you are careful enough not to break the unwrapped entries, repacking and re-reading of refs (I think these three are the reasons we have separate lists), I am fine with that change. I also think some callers of do_for_each_refs (this includes the userland that use git-for-each-ref and/or git-show-ref) expect the traversal to be sorted, so I would like to keep that sorted output behaviour. An additional hash to speed up look-up operation is probably a good thing to have.