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

Re: [PATCH] help.c: strip suffix only if the STRIP_EXTENSION defined

From
Alexander Kuleshov <kuleshovmail@gmail.com>
Date
Mar 16, 2016, 16:20 UTC
Message-ID
<CANCZXo5m-SF5qHxEgEUSPMaNEkcrZD07qbyfcmMurLVmBDRw+g@mail.gmail.com>
In-Reply-To
<CACsJy8ARrpu=7JJ0=viuNN0pN7wae8FWRN96EqtiH9bOF_vypw@mail.gmail.com>
On Wed, Mar 16, 2016 at 8:47 PM, Duy Nguyen <pclouds@gmail.com> wrote:
Show 12 quoted lines
> On Wed, Mar 16, 2016 at 9:27 PM, Alexander Kuleshov
> <kuleshovmail@gmail.com> wrote:
>> We stripping extension in the list_commands_in_dir() to get
>> commands without '.exe' suffix. Let's do it only if STRIP_EXTENSION
>> is defined to not spend time for unnecessary strip_suffix() call in
>> this case.
>
> Unless the time saving is significant, I'm against this change. It
> makes it harder to spot compile bugs in #ifdef'd code that's only
> active on Windows (imagine somebody renames "ent" or change its type).
> If you can do something like strip_extension() in git.c, it's better.
> Or maybe just refactor that function a bit and share it with help.c
Yes, agree. Will think about this.
Previous: Duy NguyenNext: Jeff King
Message 3 of 6 in “help.c: strip suffix only if the STRIP_EXTENSION defined”
  1. help.c: strip suffix only if the STRIP_EXTENSION definedAlexander Kuleshov, Mar 16, 2016
  2. Duy NguyenMar 16, 2016
  3. Alexander KuleshovMar 16, 2016
  4. Jeff KingMar 16, 2016
  5. Alexander KuleshovMar 16, 2016
  6. Jeff KingMar 16, 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.