git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCHv2] parse-options: report uncorrupted multi-byte options

From
Duy Nguyen <pclouds@gmail.com>
Date
Feb 12, 2013, 01:21 UTC
Message-ID
<CACsJy8BByNnEhhE3TieM_kOy65t75rmB45ZzjJJ8AtL2N4-UFA@mail.gmail.com>
In-Reply-To
<1360624428-4728-1-git-send-email-kusmabite@gmail.com>
On Tue, Feb 12, 2013 at 6:13 AM, Erik Faye-Lund <kusmabite@gmail.com> wrote:
Show 8 quoted lines
> 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.

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

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.

-- 
Duy
Previous: Jeff KingNext: Junio C Hamano
Message 4 of 6 in “[PATCHv2] parse-options: report uncorrupted multi-byte options”
  1. Erik Faye-LundFeb 11, 2013
  2. Junio C HamanoFeb 11, 2013
  3. Jeff KingFeb 12, 2013
  4. Duy NguyenFeb 12, 2013
  5. Junio C HamanoFeb 12, 2013
  6. Duy NguyenFeb 12, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.