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

Re: How git detects changes during commit?

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Oct 27, 2010, 20:54 UTC
Message-ID
<20101027205441.GA8242@burratino>
In-Reply-To
<1288211811436-5680208.post@n2.nabble.com>
Hi,
longphant wrote:
> Say you check out a directory of 100 files. You edit 5 of the files, and you
> go to commit the directory back. How does git know which of the 100 files
> were modified (not all of them were)?

The lstat system call. See the git-update-index(1) manual for some hints (since most high-level commands do the equivalent of "git update-index --refresh -q" before working with the work tree).

Hope that helps, Jonathan

Previous: longphantNext: longphant
Message 2 of 3 in “How git detects changes during commit?”
  1. longphantOct 27, 2010
  2. Jonathan NiederOct 27, 2010
  3. longphantOct 28, 2010

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.