Re: [PATCH v4 3/8] branch: roll show_detached HEAD into regular ref_list
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Sep 17, 2015, 14:18 UTC
- Message-ID
- <vpqpp1hqgcd.fsf@anie.imag.fr>
- In-Reply-To
- <CAOLa=ZQxounTiJk0t+zB2-7=UQa8oL+uJ9EQpTkWL7kYFHjxwQ@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> 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/