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

Re: [PATCH v2 3/4] Speed up is_git_command() by checking early for internal commands

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 3, 2014, 18:00 UTC
Message-ID
<xmqqob3tlzco.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20140103154426.GA23534@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 11 quoted lines
> On Thu, Jan 02, 2014 at 11:41:05AM -0800, Junio C Hamano wrote:
>
>>  - builtin/merge.c is the same, but it is conceptually even worse.
>>    It has the end-user supplied string and wants to see if it is a
>>    valid strategy.  If the user wants to use a custom strategy, a
>>    single stat() to make sure if it exists should suffice, and the
>>    error codepath should load the command list to present the names
>>    of available ones in the error message.
>
> Is it a single stat()? I think we would need to check each element of
> $PATH. 
Yeah, load_command_list() iterates over the members of env_path.
> Though in practice, the exec-dir would be the first thing we
> check, and where we would find the majority of hits. So it would still
> be a win, as we would avoid touching anything but the exec-dir in the
> common case.
Exactly.
Previous: Jeff KingNext: Kent R. Spillner
Message 10 of 16 in “[PATCH v2 0/4]”
  1. 0/4 Sebastian Schuberth, Jan 2, 2014
  2. 1/4 Consistently use the term "builtin" instead of "internal command"Sebastian Schuberth, Jan 2, 2014
  3. Jonathan NiederJan 2, 2014
  4. Sebastian SchuberthJan 2, 2014
  5. Sebastian SchuberthJan 22, 2014
  6. 2/4 Call load_command_list() only when it is neededSebastian Schuberth, Jan 2, 2014
  7. 3/4 Speed up is_git_command() by checking early for internal commandsSebastian Schuberth, Jan 2, 2014
  8. Junio C HamanoJan 2, 2014
  9. Jeff KingJan 3, 2014
  10. Junio C HamanoJan 3, 2014
  11. Kent R. SpillnerJan 3, 2014
  12. Sebastian SchuberthJan 5, 2014
  13. Sebastian SchuberthJan 22, 2014
  14. 4/4 Move builtin-related implementations to a new builtin.c fileSebastian Schuberth, Jan 2, 2014
  15. Junio C HamanoJan 2, 2014
  16. Sebastian SchuberthJan 2, 2014

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.