{"thread":{"id":"25565","subject":"How git detects changes during commit?","startedAt":"2010-10-27T20:36:51Z","lastAt":"2010-10-28T17:23:57Z","messageCount":3,"participants":["longphant","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"154575","messageId":"1288211811436-5680208.post@n2.nabble.com","threadId":"25565","inReplyTo":null,"subject":"How git detects changes during commit?","fromName":"longphant","fromEmail":"longphant@yahoo.com","sentAt":"2010-10-27T20:36:51Z","receivedAt":"2010-10-27T20:36:51Z","isPatch":false,"sender":{"key":"longphant@yahoo.com","avatar":null},"body":"\nSay you check out a directory of 100 files. You edit 5 of the files, and you\ngo to commit the directory back. How does git know which of the 100 files\nwere modified (not all of them were)?\n-- \nView this message in context: http://git.661346.n2.nabble.com/How-git-detects-changes-during-commit-tp5680208p5680208.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"154577","messageId":"20101027205441.GA8242@burratino","threadId":"25565","inReplyTo":"1288211811436-5680208.post@n2.nabble.com","subject":"Re: How git detects changes during commit?","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-27T20:54:41Z","receivedAt":"2010-10-27T20:54:41Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nlongphant wrote:\n\n> Say you check out a directory of 100 files. You edit 5 of the files, and you\n> go to commit the directory back. How does git know which of the 100 files\n> were modified (not all of them were)?\n\nThe lstat system call.  See the git-update-index(1) manual for some\nhints (since most high-level commands do the equivalent of\n\"git update-index --refresh -q\" before working with the work tree).\n\nHope that helps,\nJonathan\n"},{"id":"154641","messageId":"1288286637497-5683536.post@n2.nabble.com","threadId":"25565","inReplyTo":"20101027205441.GA8242@burratino","subject":"Re: How git detects changes during commit?","fromName":"longphant","fromEmail":"longphant@yahoo.com","sentAt":"2010-10-28T17:23:57Z","receivedAt":"2010-10-28T17:23:57Z","isPatch":false,"sender":{"key":"longphant@yahoo.com","avatar":null},"body":"\nThanks, that is a lot of help. I am a complete noob to version control, so I\nwas wondering if you could give me a noobie tutorial of how it works. Does\ngit lstat each file that is committed and then check the time of last\nmodification? Or does it lstat the directory?\n-- \nView this message in context: http://git.661346.n2.nabble.com/How-git-detects-changes-during-commit-tp5680208p5683536.html\nSent from the git mailing list archive at Nabble.com.\n"}]}