summaryrefslogtreecommitdiff
path: root/Documentation/revisions.txt
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2012-08-25 18:17:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-08-27 18:42:28 (GMT)
commit1452bd64f14efd888fe9c732f603173ba7fa595e (patch)
tree4d9e48433340d151ee32802fdd52ab634adf9b87 /Documentation/revisions.txt
parentb52183179bb0a97ea4d91d1248aca303d8e8f892 (diff)
downloadgit-1452bd64f14efd888fe9c732f603173ba7fa595e.zip
git-1452bd64f14efd888fe9c732f603173ba7fa595e.tar.gz
git-1452bd64f14efd888fe9c732f603173ba7fa595e.tar.bz2
branch -v: align even when branch names are in UTF-8
Branch names are usually in ASCII so they are not the problem. The problem most likely comes from "(no branch)" translation, which is in UTF-8 and makes display-width calculation just wrong. Clarify this by renaming the field "len" in struct ref_item to "width", as it stores the display-width and is used to compute the width of the screen needed to show the names of all the branches, and compute the display width using utf8_strwidth(), not byte-length with strlen(). Update document to mention the fact that we may want ref names in UTF-8. Encodings that produce invalid UTF-8 are safe as utf8_strwidth() falls back to strlen(). The ones that incidentally produce valid UTF-8 sequences will cause misalignment. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/revisions.txt')
-rw-r--r--Documentation/revisions.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt
index dc0070b..175d397 100644
--- a/Documentation/revisions.txt
+++ b/Documentation/revisions.txt
@@ -55,6 +55,8 @@ when you run `git cherry-pick`.
+
Note that any of the 'refs/*' cases above may come either from
the '$GIT_DIR/refs' directory or from the '$GIT_DIR/packed-refs' file.
+While the ref name encoding is unspecified, UTF-8 is prefered as
+some output processing may assume ref names in UTF-8.
'<refname>@\{<date>\}', e.g. 'master@\{yesterday\}', 'HEAD@\{5 minutes ago\}'::
A ref followed by the suffix '@' with a date specification