git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git diff infinite loop at attempt to diff two specific commits
@ 2009-07-05 17:37 Alexander Toresson
  2009-07-05 18:12 ` Björn Steinbrink
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Toresson @ 2009-07-05 17:37 UTC (permalink / raw)
  To: git

Hello,

I've got problems with git diff, it hangs in an infinite loop when
attempting to generate a diff between two specific commits. Commands
to reproduce:

git clone git://eulex.zapto.org/nightfall.git
cd nightfall
git diff --stat 597711..61a139

(Note that the clone needs to fetch 16mb)

I'm running git 1.6.3.3.

Regards, Alexander Toresson

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git diff infinite loop at attempt to diff two specific commits
  2009-07-05 17:37 git diff infinite loop at attempt to diff two specific commits Alexander Toresson
@ 2009-07-05 18:12 ` Björn Steinbrink
  2009-07-05 18:22   ` Matt Pearson
  0 siblings, 1 reply; 5+ messages in thread
From: Björn Steinbrink @ 2009-07-05 18:12 UTC (permalink / raw)
  To: Alexander Toresson; +Cc: git

On 2009.07.05 19:37:44 +0200, Alexander Toresson wrote:
> Hello,
> 
> I've got problems with git diff, it hangs in an infinite loop when
> attempting to generate a diff between two specific commits. Commands
> to reproduce:
> 
> git clone git://eulex.zapto.org/nightfall.git
> cd nightfall
> git diff --stat 597711..61a139
> 
> (Note that the clone needs to fetch 16mb)
> 
> I'm running git 1.6.3.3.

FWIW, it "hangs" on the save.xml file. The old version is 1.2M, the new
one is 9M. Using the patience diff algorithm to compare them takes about
5 seconds here, while the default algorithm took 6m15s.

HTH
Björn

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git diff infinite loop at attempt to diff two specific commits
  2009-07-05 18:12 ` Björn Steinbrink
@ 2009-07-05 18:22   ` Matt Pearson
  2009-07-05 20:09     ` Alexander Toresson
  0 siblings, 1 reply; 5+ messages in thread
From: Matt Pearson @ 2009-07-05 18:22 UTC (permalink / raw)
  To: Björn Steinbrink; +Cc: Alexander Toresson, git

2009/7/5 Björn Steinbrink <B.Steinbrink@gmx.de>:
> On 2009.07.05 19:37:44 +0200, Alexander Toresson wrote:
>> Hello,
>>
>> I've got problems with git diff, it hangs in an infinite loop when
>> attempting to generate a diff between two specific commits. Commands
>> to reproduce:
>>
>> git clone git://eulex.zapto.org/nightfall.git
>> cd nightfall
>> git diff --stat 597711..61a139
>>
>> (Note that the clone needs to fetch 16mb)
>>
>> I'm running git 1.6.3.3.
>
> FWIW, it "hangs" on the save.xml file. The old version is 1.2M, the new
> one is 9M. Using the patience diff algorithm to compare them takes about
> 5 seconds here, while the default algorithm took 6m15s.

I can confirm this for the 1.6.0.4 shipped with Ubuntu Jaunty (so this
would seem to not be a recent change). Actually, it may be worse: mine
is still running after 8 minutes, and this machine is almost
brand-new. Normal diff -u on the two versions of the file finishes in
under a second.

On an unrelated note, it's usually a bad idea to have files like
configure and *.suo in the repo (and possibly this save.xml as well).

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git diff infinite loop at attempt to diff two specific commits
  2009-07-05 18:22   ` Matt Pearson
@ 2009-07-05 20:09     ` Alexander Toresson
  2009-07-05 21:21       ` Matt Pearson
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Toresson @ 2009-07-05 20:09 UTC (permalink / raw)
  To: git

2009/7/5 Matt Pearson <404emailnotfound@gmail.com>:
> 2009/7/5 Björn Steinbrink <B.Steinbrink@gmx.de>:
>> On 2009.07.05 19:37:44 +0200, Alexander Toresson wrote:
>>> Hello,
>>>
>>> I've got problems with git diff, it hangs in an infinite loop when
>>> attempting to generate a diff between two specific commits. Commands
>>> to reproduce:
>>>
>>> git clone git://eulex.zapto.org/nightfall.git
>>> cd nightfall
>>> git diff --stat 597711..61a139
>>>
>>> (Note that the clone needs to fetch 16mb)
>>>
>>> I'm running git 1.6.3.3.
>>
>> FWIW, it "hangs" on the save.xml file. The old version is 1.2M, the new
>> one is 9M. Using the patience diff algorithm to compare them takes about
>> 5 seconds here, while the default algorithm took 6m15s.
>
> I can confirm this for the 1.6.0.4 shipped with Ubuntu Jaunty (so this
> would seem to not be a recent change). Actually, it may be worse: mine
> is still running after 8 minutes, and this machine is almost
> brand-new. Normal diff -u on the two versions of the file finishes in
> under a second.
>
> On an unrelated note, it's usually a bad idea to have files like
> configure and *.suo in the repo (and possibly this save.xml as well).
>

Ah! I shouldn't really have had that file in version control, I can
understand that it would be slow to diff a 9mb xml file. On the other
hand, is there a way to mark the file so git won't attempt to diff it,
but will just dispose of the old contents and use the new contents?

As for the configure file, it's convenient for users to not have to
have autoconf installed to build it. I don't really know what *.suo
does nor do I think I added it, so I'll check up on that.

Thank you.

// Alexander

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git diff infinite loop at attempt to diff two specific commits
  2009-07-05 20:09     ` Alexander Toresson
@ 2009-07-05 21:21       ` Matt Pearson
  0 siblings, 0 replies; 5+ messages in thread
From: Matt Pearson @ 2009-07-05 21:21 UTC (permalink / raw)
  To: Alexander Toresson; +Cc: git, Björn Steinbrink

[ please don't prune the CC list; I've re-added Björn ]

On Sun, Jul 5, 2009 at 16:09, Alexander
Toresson<alexander.toresson@gmail.com> wrote:
> 2009/7/5 Matt Pearson <404emailnotfound@gmail.com>:
>> 2009/7/5 Björn Steinbrink <B.Steinbrink@gmx.de>:
>>> On 2009.07.05 19:37:44 +0200, Alexander Toresson wrote:
>>>> Hello,
>>>>
>>>> I've got problems with git diff, it hangs in an infinite loop when
>>>> attempting to generate a diff between two specific commits. Commands
>>>> to reproduce:
>>>>
>>>> git clone git://eulex.zapto.org/nightfall.git
>>>> cd nightfall
>>>> git diff --stat 597711..61a139
>>>>
>>>> (Note that the clone needs to fetch 16mb)
>>>>
>>>> I'm running git 1.6.3.3.
>>>
>>> FWIW, it "hangs" on the save.xml file. The old version is 1.2M, the new
>>> one is 9M. Using the patience diff algorithm to compare them takes about
>>> 5 seconds here, while the default algorithm took 6m15s.
>>
>> I can confirm this for the 1.6.0.4 shipped with Ubuntu Jaunty (so this
>> would seem to not be a recent change). Actually, it may be worse: mine
>> is still running after 8 minutes, and this machine is almost
>> brand-new. Normal diff -u on the two versions of the file finishes in
>> under a second.
>>
>> On an unrelated note, it's usually a bad idea to have files like
>> configure and *.suo in the repo (and possibly this save.xml as well).
>>
>
> Ah! I shouldn't really have had that file in version control, I can
> understand that it would be slow to diff a 9mb xml file. On the other
> hand, is there a way to mark the file so git won't attempt to diff it,
> but will just dispose of the old contents and use the new contents?
>
> As for the configure file, it's convenient for users to not have to
> have autoconf installed to build it. I don't really know what *.suo
> does nor do I think I added it, so I'll check up on that.
>
> Thank you.

Slow is a relative term; Git is still taking several orders of
magnitude longer than it should even on such a large file (it takes
over 10 times as long as diffing v2.6.11 to HEAD on the kernel tree,
and that patch is ~400 MB). Plus, as I noted above, GNU diff can do it
in less than a second.

You can disable diffing by adding the following line to .gitattributes
(see gitattributes(5)):
save.xml -diff

Having the configure script in the repo pollutes the diffs. Anybody
who's going to check a project out of source control (instead of using
a tarball) will not have a problem running autoreconf once to get
things working. *.suo and *.vcproj.user contain user-specific settings
for the Visual Studio solution and project, and shouldn't be tracked
in git either. You should really create a proper .gitignore for your
project.

Matt

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-07-05 21:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-05 17:37 git diff infinite loop at attempt to diff two specific commits Alexander Toresson
2009-07-05 18:12 ` Björn Steinbrink
2009-07-05 18:22   ` Matt Pearson
2009-07-05 20:09     ` Alexander Toresson
2009-07-05 21:21       ` Matt Pearson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).