{"thread":{"id":"17835","subject":"git commit <path> scanning entire working tree?","startedAt":"2009-02-16T22:58:08Z","lastAt":"2009-02-18T02:25:56Z","messageCount":7,"participants":["skillzero@gmail.com","Junio C Hamano","Boyd Stephen Smith Jr."],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"105025","messageId":"2729632a0902161458m732af362od59e5f35af5643c3@mail.gmail.com","threadId":"17835","inReplyTo":null,"subject":"git commit <path> scanning entire working tree?","fromName":"","fromEmail":"skillzero@gmail.com","sentAt":"2009-02-16T22:58:08Z","receivedAt":"2009-02-16T22:58:08Z","isPatch":false,"sender":{"key":"skillzero@gmail.com","avatar":null},"body":"When I do a 'git commit <path to a single file>', git seems to scan\nthe entire working tree. Since my tree is relatively large (and when\non Windows, stat'ing is even slower), it takes quite a while (5 or so\nseconds) before I can even edit the commit message.\n\nIs there a reason it needs to scan like this when the commit command\nspecifies a specific path? It seems like it would only need to scan\nthe path I've specified.\n"},{"id":"105034","messageId":"7vwsbpewkl.fsf@gitster.siamese.dyndns.org","threadId":"17835","inReplyTo":"2729632a0902161458m732af362od59e5f35af5643c3@mail.gmail.com","subject":"Re: git commit <path> scanning entire working tree?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-17T00:28:10Z","receivedAt":"2009-02-17T00:28:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"skillzero@gmail.com writes:\n\n> When I do a 'git commit <path to a single file>', git seems to scan\n> the entire working tree. Since my tree is relatively large (and when\n> on Windows, stat'ing is even slower), it takes quite a while (5 or so\n> seconds) before I can even edit the commit message.\n\nDo you mean you edit the commit message, starting from the message\ntemplate \"git commit\" gives you?\n\nThe template lists \"Changes to be committed\" (which obviously would list\nonly the path that matches the single pathspec you give to the command,\nand there is no need to scan the whole tree -- it only needs to check the\nfile or a directory hierarchy if the pathspec matches a directory), but\nalso \"Changed but not updated\" and \"Untracked files\".  You cannot generate\nthe latter two lists without checking with your work tree.\n"},{"id":"105066","messageId":"200902162057.48460.bss@iguanasuicide.net","threadId":"17835","inReplyTo":"7vwsbpewkl.fsf@gitster.siamese.dyndns.org","subject":"Re: git commit <path> scanning entire working tree?","fromName":"Boyd Stephen Smith Jr.","fromEmail":"bss@iguanasuicide.net","sentAt":"2009-02-17T02:57:47Z","receivedAt":"2009-02-17T02:57:47Z","isPatch":false,"sender":{"key":"bss@iguanasuicide.net","avatar":"https://gravatar.com/avatar/84b95eeff194b816c1568b1339e63e4b229825298664a9037b9f1ec713ead1e3?d=mp&s=160"},"body":"On Monday 16 February 2009 18:28:10 Junio C Hamano wrote:\n> skillzero@gmail.com writes:\n> > When I do a 'git commit <path to a single file>', git seems to scan\n> > the entire working tree.  [I]t takes quite a while (5 or so\n> > seconds) before I can even edit the commit message.\n>\n> Do you mean you edit the commit message, starting from the message\n> template \"git commit\" gives you?\n>\n> The template lists \"Changes to be committed\", but\n> also \"Changed but not updated\" and \"Untracked files\".  You cannot generate\n> the latter two lists without checking with your work tree.\n\nSo, specify one or more -m options and you shouldn't see the scan.\n-- \nBoyd Stephen Smith Jr.                   ,= ,-_-. =.\nbss@iguanasuicide.net                   ((_/)o o(\\_))\nICQ: 514984 YM/AIM: DaTwinkDaddy         `-'(. .)`-'\nhttp://iguanasuicide.net/                    \\_/\n\n"},{"id":"105070","messageId":"2729632a0902161937o4ac3a1aeg143dda509ba5e384@mail.gmail.com","threadId":"17835","inReplyTo":"7vwsbpewkl.fsf@gitster.siamese.dyndns.org","subject":"Re: git commit <path> scanning entire working tree?","fromName":"","fromEmail":"skillzero@gmail.com","sentAt":"2009-02-17T03:37:57Z","receivedAt":"2009-02-17T03:37:57Z","isPatch":false,"sender":{"key":"skillzero@gmail.com","avatar":null},"body":"On Mon, Feb 16, 2009 at 4:28 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Do you mean you edit the commit message, starting from the message\n> template \"git commit\" gives you?\n\nYes, there's a large delay from me entering 'git commit -a' and when\nthe editor shows up.\n\n> The template lists \"Changes to be committed\" (which obviously would list\n> only the path that matches the single pathspec you give to the command,\n> and there is no need to scan the whole tree -- it only needs to check the\n> file or a directory hierarchy if the pathspec matches a directory), but\n> also \"Changed but not updated\" and \"Untracked files\".  You cannot generate\n> the latter two lists without checking with your work tree.\n\nIt seems like it shouldn't scan/show things outside of the path. If\nI've specified a path on the command line, I most likely only care\nabout things in that path. I think it would make committing specific\npaths much faster when you have a large tree. However, it would\neliminate information (changed/untracked files outside that path), if\npeople are relying on that.\n"},{"id":"105077","messageId":"200902162350.50946.bss@iguanasuicide.net","threadId":"17835","inReplyTo":"2729632a0902161937o4ac3a1aeg143dda509ba5e384@mail.gmail.com","subject":"Re: git commit <path> scanning entire working tree?","fromName":"Boyd Stephen Smith Jr.","fromEmail":"bss@iguanasuicide.net","sentAt":"2009-02-17T05:50:50Z","receivedAt":"2009-02-17T05:50:50Z","isPatch":false,"sender":{"key":"bss@iguanasuicide.net","avatar":"https://gravatar.com/avatar/84b95eeff194b816c1568b1339e63e4b229825298664a9037b9f1ec713ead1e3?d=mp&s=160"},"body":"On Monday 16 February 2009 21:37:57 you wrote:\n> On Mon, Feb 16, 2009 at 4:28 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> > The template lists \"Changes to be committed\", but\n> > also \"Changed but not updated\" and \"Untracked files\".  You cannot\n> > generate the latter two lists without checking with your work tree.\n>\n> It seems like it shouldn't scan/show things outside of the path. If\n> I've specified a path on the command line, I most likely only care\n> about things in that path. I think it would make committing specific\n> paths much faster when you have a large tree. However, it would\n> eliminate information (changed/untracked files outside that path), if\n> people are relying on that.\n\nPatches reviewed (and possibly accepted) here.\n-- \nBoyd Stephen Smith Jr.                   ,= ,-_-. =.\nbss@iguanasuicide.net                   ((_/)o o(\\_))\nICQ: 514984 YM/AIM: DaTwinkDaddy         `-'(. .)`-'\nhttp://iguanasuicide.net/                    \\_/\n\n"},{"id":"105083","messageId":"7vvdr98rkd.fsf@gitster.siamese.dyndns.org","threadId":"17835","inReplyTo":"2729632a0902161937o4ac3a1aeg143dda509ba5e384@mail.gmail.com","subject":"Re: git commit <path> scanning entire working tree?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-17T07:12:50Z","receivedAt":"2009-02-17T07:12:50Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"skillzero@gmail.com writes:\n\n> ... However, it would\n> eliminate information (changed/untracked files outside that path), if\n> people are relying on that.\n\nPeople do rely on that information.  Why else we would spend cycles to show\nthem?\n\nThere is a precedence to allow a configuration variable to skip various\ncomputation to help slow systems, e.g. 6c2ce04 (Add argument 'no'\ncommit/status option -u|--untracked-files, 2008-06-05).\n"},{"id":"105263","messageId":"2729632a0902171825g2078755cx6b966417240a59ca@mail.gmail.com","threadId":"17835","inReplyTo":"7vvdr98rkd.fsf@gitster.siamese.dyndns.org","subject":"Re: git commit <path> scanning entire working tree?","fromName":"","fromEmail":"skillzero@gmail.com","sentAt":"2009-02-18T02:25:56Z","receivedAt":"2009-02-18T02:25:56Z","isPatch":false,"sender":{"key":"skillzero@gmail.com","avatar":null},"body":"On Mon, Feb 16, 2009 at 11:12 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> skillzero@gmail.com writes:\n\n> People do rely on that information.  Why else we would spend cycles to show\n> them?\n\nMy guess was that most people didn't work with very large trees. For\nexample, the Linux kernel tree stat's pretty quickly (.7 seconds when\nhot on my machine), but my tree contains the code for an entire OS\ndistribution so even on a fast machine and OS, it takes many seconds.\n\nMy thinking was that in the case when a path was specified, people\nmight be less interested in changes/untracked files outside that path\n(although I may be totally wrong). If a path wasn't specified, I can\nsee why it would be useful to show everything. I tend to do a 'git\nstatus' then a bunch of 'git commit <path>' commands.\n\n> There is a precedence to allow a configuration variable to skip various\n> computation to help slow systems, e.g. 6c2ce04 (Add argument 'no'\n> commit/status option -u|--untracked-files, 2008-06-05).\n\nThanks, I'll check it out. If that doesn't do what I need, maybe I can\ntrying changing git to add support for automatically skipping files\noutside the specifies path and submit a patch for you guys to rip to\nshreds :)\n"}]}