Re: git annotate runs out of memory
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Dec 12, 2007, 02:39 UTC
- Message-ID
- <alpine.LFD.0.9999.0712111834510.25032@woody.linux-foundation.org>
- In-Reply-To
- <alpine.LFD.0.9999.0712111816220.25032@woody.linux-foundation.org>
On Tue, 11 Dec 2007, Linus Torvalds wrote:
> > But no, I didn't create a test-case.
This *should* trigger the special case:
mkdir test-dir cd test-dir git init (echo -n a ; yes '' | dd count=2) > file git add file git commit -m "'a' + 1k newlines" (echo -n b ; yes '' | dd count=2) > file git add file git commit -m "'b' + 1k newlines"
and it all seems to work fine.
But I didn't actually check that it really triggered, this is just creating a 1025-byte file that has a single character and then 1024 newlines. So when the logic removes the shared tail (all the newlines), it leaves a single-character newlineless buffer for diff, and no, git-blame didn't care, and got the right answer.
Linus