]> git.ipfire.org Git - thirdparty/git.git/commitdiff
CodingGuidelines: use octal escapes, not hex
authorJonathan Tan <jonathantanmy@google.com>
Wed, 14 Jun 2023 21:31:45 +0000 (14:31 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Jun 2023 21:44:19 +0000 (14:44 -0700)
Extend the shell-scripting section of CodingGuidelines to suggest octal
escape sequences (e.g. "\302\242") over hexadecimal (e.g. "\xc2\xa2")
since the latter can be a source of portability problems.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/CodingGuidelines

index 003393ed161dab04a5c73269d49fa2e2f2fdd1f6..39ef53c2372d59d8f04f2315c5e2a61945bf630f 100644 (file)
@@ -188,6 +188,10 @@ For shell scripts specifically (not exhaustive):
    hopefully nobody starts using "local" before they are reimplemented
    in C ;-)
 
+ - Use octal escape sequences (e.g. "\302\242"), not hexadecimal (e.g.
+   "\xc2\xa2") in printf format strings, since hexadecimal escape
+   sequences are not portable.
+
 
 For C programs: