Re: [PATCH] line-log: fix crash when --first-parent is used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 3, 2014 at 12:58 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:

>> line-log tries to access all parents of a commit, but only the first
>> parent has been loaded if "--first-parent" is specified, resulting
>> in a crash.
>>
>> Limit the number of parents to one if "--first-parent" is specified.
>>

> [...]
> Tzvetan, can we have a test for this one?

Here is a sequence of commands to reproduce the crash:

git init
echo "1" > a.txt && git add a.txt && git commit -m "a"
git checkout -b branch
echo "2" > b.txt && git add b.txt && git commit -m "b"
git checkout master
git merge branch --no-ff -m "merge"
git log --first-parent -L 1,1:a.txt

I am not sure whether you have a requirement for a formal test
included with the patch, but if there is one, I am happy to
rework it.

This is a very simple fix for the crash, though possibly
a "real" comprehensive fix may be needed. I am not sure.
The real cause is that with "--first-parent" some commit
objects are never loaded from disk but may still be accessed.

(sorry about my formatting - have to use GMail)

regards,
Tzvetan
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]