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

Re: git commit <path> scanning entire working tree?

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 17, 2009, 00:28 UTC
Message-ID
<7vwsbpewkl.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<2729632a0902161458m732af362od59e5f35af5643c3@mail.gmail.com>
skillzero@gmail.com writes:
> When I do a 'git commit <path to a single file>', git seems to scan
> the entire working tree. Since my tree is relatively large (and when
> on Windows, stat'ing is even slower), it takes quite a while (5 or so
> seconds) before I can even edit the commit message.

Do you mean you edit the commit message, starting from the message template "git commit" gives you?

The template lists "Changes to be committed" (which obviously would list only the path that matches the single pathspec you give to the command, and there is no need to scan the whole tree -- it only needs to check the file or a directory hierarchy if the pathspec matches a directory), but also "Changed but not updated" and "Untracked files". You cannot generate the latter two lists without checking with your work tree.

Previous: skillzero@gmail.comNext: Boyd Stephen Smith Jr.
Message 2 of 7 in “git commit <path> scanning entire working tree?”
  1. skillzero@gmail.comFeb 16, 2009
  2. Junio C HamanoFeb 17, 2009
  3. Boyd Stephen Smith Jr.Feb 17, 2009
  4. skillzero@gmail.comFeb 17, 2009
  5. Boyd Stephen Smith Jr.Feb 17, 2009
  6. Junio C HamanoFeb 17, 2009
  7. skillzero@gmail.comFeb 18, 2009

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.