Subject: Re: [PATCH v4 3/8] branch: roll show_detached HEAD into regular ref_list

From: Matthieu Moy <[email-masked]>
Date: Thu, 17 Sep 2015 16:18:42 +0200

Karthik Nayak <[email-masked]> writes:

> So either we could introduce a new atom for sorting something like
> `branch_sort` which uses the FILTER_REFS_(DETACHED_HEAD | BRANCHES |
> REMOTES)

I don't think you need a new atom. You can just change the sorting
function to consider that detached HEAD is always first, and when
comparing two non-detached-HEAD branches, use the atom supplied by the
user.

That would mean the detached HEAD would be displayed first regardless of
--sort (which is the case right now).

Introducing a new atom would mean that "git branch --sort authorname"
would not use this new atom, hence the HEAD would be sorted like the
others. I don't know if this is good or bad.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/