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

Re: [PATCH] pathspec: prevent empty strings as pathspecs

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jun 19, 2016, 02:23 UTC
Message-ID
<CAPig+cR5V7ZX8J9caYKTv4ECG_GP=N6geYQ+eReigicUC27cnA@mail.gmail.com>
In-Reply-To
<1466300967.28660.9.camel@frank>
On Sat, Jun 18, 2016 at 9:49 PM, David Turner <novalis@novalis.org> wrote:
Show 7 quoted lines
> On Sat, 2016-06-18 at 20:57 -0400, Emily Xie wrote:
>> +     while (argv[n]) {
>> +             if (*argv[n] == '\0') {
>> +                     die("Empty string is not a valid pathspec.");
>> +             }
>
> nit: git style doesn't use {} on one-statement ifs.

Also, drop the full-stop (period) from the error message and, to be consistent with modern practice, don't capitalize the first word. Finally, the string should be localizable, so wrap it in _(...):

    die(_("empty string not valid pathspec"));
Previous: David TurnerNext: Junio C Hamano
Message 3 of 7 in “pathspec: prevent empty strings as pathspecs”
  1. pathspec: prevent empty strings as pathspecsEmily Xie, Jun 19, 2016
  2. David TurnerJun 19, 2016
  3. Eric SunshineJun 19, 2016
  4. Junio C HamanoJun 19, 2016
  5. David TurnerJun 19, 2016
  6. Junio C HamanoJun 19, 2016
  7. Emily XieJun 19, 2016

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.