git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jonathan Tan <jonathantanmy@google.com>
Cc: git@vger.kernel.org, sunshine@sunshineco.com
Subject: Re: [PATCH v2] CodingGuidelines: use octal escapes, not hex
Date: Tue, 13 Jun 2023 17:28:38 -0700	[thread overview]
Message-ID: <xmqqy1km28g9.fsf@gitster.g> (raw)
In-Reply-To: <20230614001558.277755-1-jonathantanmy@google.com> (Jonathan Tan's message of "Tue, 13 Jun 2023 17:15:58 -0700")

Jonathan Tan <jonathantanmy@google.com> writes:

> 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>
> ---
> I've used Eric's suggestion for the commit message and limited the scope
> of the documentation change to printf.
>
> Version 1 was here:
> https://lore.kernel.org/git/20230613172927.19019-1-jonathantanmy@google.com/
> ---
>  Documentation/CodingGuidelines | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
> index 003393ed16..30ac7d2d3f 100644
> --- a/Documentation/CodingGuidelines
> +++ b/Documentation/CodingGuidelines
> @@ -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"), since the latter is not portable across commands like
> +   "printf".

I'd say

    - Use octal ... not hex..., in printf format string.

not "commands LIKE".

Thanks.


  reply	other threads:[~2023-06-14  0:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14  0:15 [PATCH v2] CodingGuidelines: use octal escapes, not hex Jonathan Tan
2023-06-14  0:28 ` Junio C Hamano [this message]
2023-06-14 21:31 ` [PATCH v3] " Jonathan Tan
2023-06-14 21:54   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqy1km28g9.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jonathantanmy@google.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).