All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Erik Faye-Lund <kusmabite@gmail.com>,
	git@vger.kernel.org, peff@peff.net, matthieu.moy@grenoble-inp.fr,
	tboegi@web.de
Subject: Re: [PATCHv2] parse-options: report uncorrupted multi-byte options
Date: Mon, 11 Feb 2013 18:10:10 -0800	[thread overview]
Message-ID: <7va9rajn99.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CACsJy8BByNnEhhE3TieM_kOy65t75rmB45ZzjJJ8AtL2N4-UFA@mail.gmail.com> (Duy Nguyen's message of "Tue, 12 Feb 2013 08:21:24 +0700")

Duy Nguyen <pclouds@gmail.com> writes:

> On Tue, Feb 12, 2013 at 6:13 AM, Erik Faye-Lund <kusmabite@gmail.com> wrote:
>> Because our command-line parser considers only one byte at the time
>> for short-options, we incorrectly report only the first byte when
>> multi-byte input was provided. This makes user-erros slightly
>> awkward to diagnose for instance under UTF-8 locale and non-English
>> keyboard layouts.
>>
>> Make the reporting code report the whole argument-string when a
>> non-ASCII short-option is detected.
>
> Similar cases:
>
> config.c:git_default_core_config() assumes core.commentchar is ascii.
> We should catch and report non-ascii chars, or simply accept it as a
> string.

That one is just an uninterpreted byte.  core.commentString might be
a nice extension to the concept, but it is an entirely different
category.

> builtin/update-index.c:cmd_update_index(): error("unknown switch
> '%c'", *ctx.opt);

This one is in the same category as this topic.

> builtin/apply.c:apply_one_fragment(): error(_("invalid start of line:
> '%c'"), first); where 'first' may be a part of utf-8 from a broken
> patch.

This is where the patch is expected to have either " ", "-" or "+",
again, anything else is an uninterpreted byte.  It is more like
reporting the file we found an error in, whose filename is not
encoded in UTF-8 to the user's terminal.

  reply	other threads:[~2013-02-12  2:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-11 23:13 [PATCHv2] parse-options: report uncorrupted multi-byte options Erik Faye-Lund
2013-02-11 23:51 ` Junio C Hamano
2013-02-12  1:00 ` Jeff King
2013-02-12  1:21 ` Duy Nguyen
2013-02-12  2:10   ` Junio C Hamano [this message]
2013-02-12  2:30     ` Duy Nguyen

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=7va9rajn99.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=kusmabite@gmail.com \
    --cc=matthieu.moy@grenoble-inp.fr \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    --cc=tboegi@web.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.