Thread (2 messages) flat view 2 messages, 2 authors, 2016-11-25

Re: [PATCH 3/3] worktree list: keep the list sorted

From: Duy Nguyen <hidden>
Date: 2016-11-25 12:20:49

On Thu, Nov 24, 2016 at 12:16 AM, Junio C Hamano [off-list ref] wrote:
More importantly, perhaps get_worktrees() should learn to take an
optional pointer to int that returns how many items are in the list?
My first thought was "yeah I remember there are many counting loop
like this" then grepped and realized this is the only place. For now I
think it's ok to leave it as is. When the second place does the same,
we'll change get_worktrees()
Alternatively, other existing callers of the function do not care
about the order, so it may not be such a good idea to always sort
the result, but it may be a good idea to teach it to take a boolean
that signals that the list should be sorted in a "natural order",
which is how "worktree list" would show them to the user?
OK. I'll make it a bit flag, not a boolean though, to avoid changing
all call sites next time.
-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help