{"thread":{"id":"20028","subject":"git diff infinite loop at attempt to diff two specific commits","startedAt":"2009-07-05T17:37:44Z","lastAt":"2009-07-05T21:21:15Z","messageCount":5,"participants":["Alexander Toresson","Björn Steinbrink","Matt Pearson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"117458","messageId":"b33ba6660907051037ve9e4176s2a1edbda8af4068f@mail.gmail.com","threadId":"20028","inReplyTo":null,"subject":"git diff infinite loop at attempt to diff two specific commits","fromName":"Alexander Toresson","fromEmail":"alexander.toresson@gmail.com","sentAt":"2009-07-05T17:37:44Z","receivedAt":"2009-07-05T17:37:44Z","isPatch":false,"sender":{"key":"alexander.toresson@gmail.com","avatar":null},"body":"Hello,\n\nI've got problems with git diff, it hangs in an infinite loop when\nattempting to generate a diff between two specific commits. Commands\nto reproduce:\n\ngit clone git://eulex.zapto.org/nightfall.git\ncd nightfall\ngit diff --stat 597711..61a139\n\n(Note that the clone needs to fetch 16mb)\n\nI'm running git 1.6.3.3.\n\nRegards, Alexander Toresson\n"},{"id":"117460","messageId":"20090705181208.GA8629@atjola.homenet","threadId":"20028","inReplyTo":"b33ba6660907051037ve9e4176s2a1edbda8af4068f@mail.gmail.com","subject":"Re: git diff infinite loop at attempt to diff two specific commits","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2009-07-05T18:12:08Z","receivedAt":"2009-07-05T18:12:08Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2009.07.05 19:37:44 +0200, Alexander Toresson wrote:\n> Hello,\n> \n> I've got problems with git diff, it hangs in an infinite loop when\n> attempting to generate a diff between two specific commits. Commands\n> to reproduce:\n> \n> git clone git://eulex.zapto.org/nightfall.git\n> cd nightfall\n> git diff --stat 597711..61a139\n> \n> (Note that the clone needs to fetch 16mb)\n> \n> I'm running git 1.6.3.3.\n\nFWIW, it \"hangs\" on the save.xml file. The old version is 1.2M, the new\none is 9M. Using the patience diff algorithm to compare them takes about\n5 seconds here, while the default algorithm took 6m15s.\n\nHTH\nBjörn\n"},{"id":"117461","messageId":"706b4240907051122s784e97abkde5628189956ceb0@mail.gmail.com","threadId":"20028","inReplyTo":"20090705181208.GA8629@atjola.homenet","subject":"Re: git diff infinite loop at attempt to diff two specific commits","fromName":"Matt Pearson","fromEmail":"404emailnotfound@gmail.com","sentAt":"2009-07-05T18:22:00Z","receivedAt":"2009-07-05T18:22:00Z","isPatch":false,"sender":{"key":"404emailnotfound@gmail.com","avatar":null},"body":"2009/7/5 Björn Steinbrink <B.Steinbrink@gmx.de>:\n> On 2009.07.05 19:37:44 +0200, Alexander Toresson wrote:\n>> Hello,\n>>\n>> I've got problems with git diff, it hangs in an infinite loop when\n>> attempting to generate a diff between two specific commits. Commands\n>> to reproduce:\n>>\n>> git clone git://eulex.zapto.org/nightfall.git\n>> cd nightfall\n>> git diff --stat 597711..61a139\n>>\n>> (Note that the clone needs to fetch 16mb)\n>>\n>> I'm running git 1.6.3.3.\n>\n> FWIW, it \"hangs\" on the save.xml file. The old version is 1.2M, the new\n> one is 9M. Using the patience diff algorithm to compare them takes about\n> 5 seconds here, while the default algorithm took 6m15s.\n\nI can confirm this for the 1.6.0.4 shipped with Ubuntu Jaunty (so this\nwould seem to not be a recent change). Actually, it may be worse: mine\nis still running after 8 minutes, and this machine is almost\nbrand-new. Normal diff -u on the two versions of the file finishes in\nunder a second.\n\nOn an unrelated note, it's usually a bad idea to have files like\nconfigure and *.suo in the repo (and possibly this save.xml as well).\n"},{"id":"117473","messageId":"b33ba6660907051309y55bd5472oc665118a1851ddce@mail.gmail.com","threadId":"20028","inReplyTo":"706b4240907051122s784e97abkde5628189956ceb0@mail.gmail.com","subject":"Re: git diff infinite loop at attempt to diff two specific commits","fromName":"Alexander Toresson","fromEmail":"alexander.toresson@gmail.com","sentAt":"2009-07-05T20:09:45Z","receivedAt":"2009-07-05T20:09:45Z","isPatch":false,"sender":{"key":"alexander.toresson@gmail.com","avatar":null},"body":"2009/7/5 Matt Pearson <404emailnotfound@gmail.com>:\n> 2009/7/5 Björn Steinbrink <B.Steinbrink@gmx.de>:\n>> On 2009.07.05 19:37:44 +0200, Alexander Toresson wrote:\n>>> Hello,\n>>>\n>>> I've got problems with git diff, it hangs in an infinite loop when\n>>> attempting to generate a diff between two specific commits. Commands\n>>> to reproduce:\n>>>\n>>> git clone git://eulex.zapto.org/nightfall.git\n>>> cd nightfall\n>>> git diff --stat 597711..61a139\n>>>\n>>> (Note that the clone needs to fetch 16mb)\n>>>\n>>> I'm running git 1.6.3.3.\n>>\n>> FWIW, it \"hangs\" on the save.xml file. The old version is 1.2M, the new\n>> one is 9M. Using the patience diff algorithm to compare them takes about\n>> 5 seconds here, while the default algorithm took 6m15s.\n>\n> I can confirm this for the 1.6.0.4 shipped with Ubuntu Jaunty (so this\n> would seem to not be a recent change). Actually, it may be worse: mine\n> is still running after 8 minutes, and this machine is almost\n> brand-new. Normal diff -u on the two versions of the file finishes in\n> under a second.\n>\n> On an unrelated note, it's usually a bad idea to have files like\n> configure and *.suo in the repo (and possibly this save.xml as well).\n>\n\nAh! I shouldn't really have had that file in version control, I can\nunderstand that it would be slow to diff a 9mb xml file. On the other\nhand, is there a way to mark the file so git won't attempt to diff it,\nbut will just dispose of the old contents and use the new contents?\n\nAs for the configure file, it's convenient for users to not have to\nhave autoconf installed to build it. I don't really know what *.suo\ndoes nor do I think I added it, so I'll check up on that.\n\nThank you.\n\n// Alexander\n"},{"id":"117474","messageId":"706b4240907051421h57c2fd76u1e9b5e1b8c7bcc8a@mail.gmail.com","threadId":"20028","inReplyTo":"b33ba6660907051309y55bd5472oc665118a1851ddce@mail.gmail.com","subject":"Re: git diff infinite loop at attempt to diff two specific commits","fromName":"Matt Pearson","fromEmail":"404emailnotfound@gmail.com","sentAt":"2009-07-05T21:21:15Z","receivedAt":"2009-07-05T21:21:15Z","isPatch":false,"sender":{"key":"404emailnotfound@gmail.com","avatar":null},"body":"[ please don't prune the CC list; I've re-added Björn ]\n\nOn Sun, Jul 5, 2009 at 16:09, Alexander\nToresson<alexander.toresson@gmail.com> wrote:\n> 2009/7/5 Matt Pearson <404emailnotfound@gmail.com>:\n>> 2009/7/5 Björn Steinbrink <B.Steinbrink@gmx.de>:\n>>> On 2009.07.05 19:37:44 +0200, Alexander Toresson wrote:\n>>>> Hello,\n>>>>\n>>>> I've got problems with git diff, it hangs in an infinite loop when\n>>>> attempting to generate a diff between two specific commits. Commands\n>>>> to reproduce:\n>>>>\n>>>> git clone git://eulex.zapto.org/nightfall.git\n>>>> cd nightfall\n>>>> git diff --stat 597711..61a139\n>>>>\n>>>> (Note that the clone needs to fetch 16mb)\n>>>>\n>>>> I'm running git 1.6.3.3.\n>>>\n>>> FWIW, it \"hangs\" on the save.xml file. The old version is 1.2M, the new\n>>> one is 9M. Using the patience diff algorithm to compare them takes about\n>>> 5 seconds here, while the default algorithm took 6m15s.\n>>\n>> I can confirm this for the 1.6.0.4 shipped with Ubuntu Jaunty (so this\n>> would seem to not be a recent change). Actually, it may be worse: mine\n>> is still running after 8 minutes, and this machine is almost\n>> brand-new. Normal diff -u on the two versions of the file finishes in\n>> under a second.\n>>\n>> On an unrelated note, it's usually a bad idea to have files like\n>> configure and *.suo in the repo (and possibly this save.xml as well).\n>>\n>\n> Ah! I shouldn't really have had that file in version control, I can\n> understand that it would be slow to diff a 9mb xml file. On the other\n> hand, is there a way to mark the file so git won't attempt to diff it,\n> but will just dispose of the old contents and use the new contents?\n>\n> As for the configure file, it's convenient for users to not have to\n> have autoconf installed to build it. I don't really know what *.suo\n> does nor do I think I added it, so I'll check up on that.\n>\n> Thank you.\n\nSlow is a relative term; Git is still taking several orders of\nmagnitude longer than it should even on such a large file (it takes\nover 10 times as long as diffing v2.6.11 to HEAD on the kernel tree,\nand that patch is ~400 MB). Plus, as I noted above, GNU diff can do it\nin less than a second.\n\nYou can disable diffing by adding the following line to .gitattributes\n(see gitattributes(5)):\nsave.xml -diff\n\nHaving the configure script in the repo pollutes the diffs. Anybody\nwho's going to check a project out of source control (instead of using\na tarball) will not have a problem running autoreconf once to get\nthings working. *.suo and *.vcproj.user contain user-specific settings\nfor the Visual Studio solution and project, and shouldn't be tracked\nin git either. You should really create a proper .gitignore for your\nproject.\n\nMatt\n"}]}