Skip to content

Commit f3eb549

Browse files
bbolligitster
authored andcommitted
update_unicode.sh: move it into contrib/update-unicode
As it's used only by a tiny minority of the Git developer population, this script does not belong into the main Git source directory. Move it into contrib/ and adjust the paths to account for the new location. Signed-off-by: Beat Bolli <dev+git@drbeat.li> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 32c239d commit f3eb549

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@
231231
/config.mak.autogen
232232
/config.mak.append
233233
/configure
234-
/unicode
235234
/tags
236235
/TAGS
237236
/cscope*

contrib/update-unicode/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
uniset/
2+
UnicodeData.txt
3+
EastAsianWidth.txt

contrib/update-unicode/README

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
TL;DR: Run update_unicode.sh after the publication of a new Unicode
2+
standard and commit the resulting unicode_widths.h file.
3+
4+
The long version
5+
================
6+
7+
The Git source code ships the file unicode_widths.h which contains
8+
tables of zero and double width Unicode code points, respectively.
9+
These tables are generated using update_unicode.sh in this directory.
10+
update_unicode.sh itself uses a third-party tool, uniset, to query two
11+
Unicode data files for the interesting code points.
12+
13+
On first run, update_unicode.sh clones uniset from Github and builds it.
14+
This requires a current-ish version of autoconf (2.69 works per December
15+
2016).
16+
17+
On each run, update_unicode.sh checks whether more recent Unicode data
18+
files are available from the Unicode consortium, and rebuilds the header
19+
unicode_widths.h with the new data. The new header can then be
20+
committed.
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
#Mn Nonspacing_Mark a nonspacing combining mark (zero advance width)
66
#Cf Format a format control character
77
#
8-
UNICODEWIDTH_H=../unicode_width.h
9-
if ! test -d unicode; then
10-
mkdir unicode
11-
fi &&
12-
( cd unicode &&
8+
cd "$(dirname "$0")"
9+
UNICODEWIDTH_H=$(git rev-parse --show-toplevel)/unicode_width.h
10+
(
1311
if ! test -f UnicodeData.txt; then
1412
wget http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt
1513
fi &&

0 commit comments

Comments
 (0)