This started out as a reading of ref-filter.c where I wondered why we needed this i18n lego. I'm not sure whether in Chinese what Matthew DeVore said in [1] is true, but in any case it seems better to leave that to the translators, re-using the string is a relatively small gain. So I think that change was really just "ASCII sort is easier than checking a flag in a sort callback", fair enough. But I thought I'd try to see how hard that patch would be. Turned out it's rather easy & I think results in better code, 4/5 gets us to that point. But 5/5 I think makes this more generally interesting. In all locales (including LC_ALL=C) we list the "HEAD detached" entry last in "git branch -l" output if you're doing a reverse sort. I don't think this makes any sense, it's a notice, not a refname to be sorted. Using the new sorting function for treating detached HEAD specially makes this trivial to fix. 1. https://lore.kernel.org/git/9bd85516f91c3e2fdefdafd51df71f75603e51f6.1560895672.git.matvore@xxxxxxxxxx/ Ævar Arnfjörð Bjarmason (5): branch: change "--local" to "--list" in comment branch tests: add to --sort tests ref-filter: add a "detached_head_first" sorting option branch: use the "detached_head_first" sorting option branch: show "HEAD detached" first under reverse sort builtin/branch.c | 3 ++- ref-filter.c | 54 +++++++++++++++++++++++++--------------- ref-filter.h | 3 +++ t/t3203-branch-output.sh | 51 ++++++++++++++++++++++++++++++++++++- wt-status.c | 4 +-- wt-status.h | 2 -- 6 files changed, 91 insertions(+), 26 deletions(-) -- 2.29.2.222.g5d2a92d10f8