]> git.ipfire.org Git - thirdparty/git.git/commit - ref-filter.c
ref-filter: sort detached HEAD lines firstly
authorMatthew DeVore <matvore@google.com>
Tue, 18 Jun 2019 22:29:15 +0000 (15:29 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 19 Jun 2019 15:24:41 +0000 (08:24 -0700)
commit28438e84e046984afc76dc891a49bd0862d555f7
tree5b86305a3fb357865d3868efd65541454f00abd5
parentaeb582a98374c094361cba1bd756dc6307432c42
ref-filter: sort detached HEAD lines firstly

Before this patch, "git branch" would put "(HEAD detached...)" and "(no
branch, rebasing...)" lines before all the other branches *in most
cases* except for when using Chinese-language messages. zh_CN generally
uses a full-width "(" symbol (codepoint FF08) to match the full-width
proportions of Chinese characters, and the translated strings we had did
use them. This meant that the detached HEAD line would appear after all
local refs and even after the remote refs if there were any.

AFAIK, it is sometimes not jarring to see the half-width parenthesis in
"full-width" text as in the CJK languages, for instance when there are
no characters preceding or following the parenthesized text fragment. By
removing the parenthesis from the localizable text, we can share strings
with wt-status.c and remove a cautionary comment to translators.

Remove the ( from the localizable portion of messages so the sorting
happens properly regardless of locale.

Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Matthew DeVore <matvore@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ref-filter.c
wt-status.c
wt-status.h