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

Re: git commit results in many lstat()s

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 1, 2017, 23:50 UTC
Message-ID
<xmqq60ktmpwl.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<DA0A42D68346B1469147552440A645039A9C57D6@ORSMSX115.amr.corp.intel.com>
"Gumbel, Matthew K" <matthew.k.gumbel@intel.com> writes:
Show 7 quoted lines
> "Junio C Hamano" <jch2355@gmail.com> writes:
>> There probably are other things that can be optimized.
>
> Yes, I think that when the user passes --only flag to git-commit, then git does not
> need to call refresh_cache() in prepare_index() in builtin/commit.c.
>
> I may experiment with that. Do you see any downside or negative side-effects?

There may be other fallouts, but one that immediately comes to mind is that it may break pre-commit hook.

When we get "--only", we prepare an temporary index to create the commit out of, and give it to the pre-commit hook. The hook expects that the cached stat information is up-to-date, iow, it does not have to do 'update-index --refresh' before using plumbing commands like "diff-index" to do its own inspection of the working tree.

Previous: Gumbel, Matthew KNext: Gumbel, Matthew K
Message 4 of 6 in “git commit results in many lstat()s”
  1. Gumbel, Matthew KFeb 1, 2017
  2. Junio C HamanoFeb 1, 2017
  3. Gumbel, Matthew KFeb 1, 2017
  4. Junio C HamanoFeb 1, 2017
  5. Gumbel, Matthew KFeb 2, 2017
  6. brian m. carlsonFeb 2, 2017

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.