Re: git commit <path> scanning entire working tree?
From: <hidden>
Date: 2016-06-15 22:46:13
On Mon, Feb 16, 2009 at 4:28 PM, Junio C Hamano [off-list ref] wrote:
Do you mean you edit the commit message, starting from the message template "git commit" gives you?
Yes, there's a large delay from me entering 'git commit -a' and when the editor shows up.
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.
It seems like it shouldn't scan/show things outside of the path. If I've specified a path on the command line, I most likely only care about things in that path. I think it would make committing specific paths much faster when you have a large tree. However, it would eliminate information (changed/untracked files outside that path), if people are relying on that.