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

git commit results in many lstat()s

From
Gumbel, Matthew K <matthew.k.gumbel@intel.com>
Date
Feb 1, 2017, 21:45 UTC
Message-ID
<DA0A42D68346B1469147552440A645039A9C56D4@ORSMSX115.amr.corp.intel.com>
Hello,
My high level problem is to speed up git commit on a large repository stored on NFS filesystem. I see via strace that it is slow because it makes a large number (~50,000) of lstat() calls in serial. Every call is a round-trip to the NFS server.
I do not understand why git commit must call lstat() on every file in the repository, even when I specify the name of the file I want to commit on the command line. Can somebody explain why it must call lstat on every file?
My command-line looks like this: git commit -uno -o -m asdf file-to-commit.txt
Secondly, are there any optimizations I can make to avoid this behavior?

Thanks, Matt

Next: Junio C Hamano
Message 1 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.