Re: in_merge_bases() is too expensive for recent "pu" update
- From
Thomas Rast <trast@inf.ethz.ch>
- Date
- Aug 28, 2012, 08:12 UTC
- Message-ID
- <877gsjmo3a.fsf@thomas.inf.ethz.ch>
- In-Reply-To
- <7va9xfpyyf.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 28 quoted lines
> Thomas Rast <trast@student.ethz.ch> writes:
>
>> diff --git i/commit.c w/commit.c
>> index 65a8485..70427ab 100644
>> --- i/commit.c
>> +++ w/commit.c
>> @@ -837,10 +837,13 @@ int in_merge_bases(struct commit *commit, struct commit **reference, int num)
>> struct commit_list *bases, *b;
>> int ret = 0;
>>
>> - if (num == 1)
>> - bases = get_merge_bases(commit, *reference, 1);
>> - else
>> + if (num != 1)
>> die("not yet");
>> +
>> + bases = merge_bases_many(commit, 1, reference);
>> + clear_commit_marks(commit, all_flags);
>> + clear_commit_marks(*reference, all_flags);
>> +
>> for (b = bases; b; b = b->next) {
>> if (!hashcmp(commit->object.sha1, b->item->object.sha1)) {
>> ret = 1;
>
> This ended up being part of the series I sent earlier, and I want to
> assign authorship to you. As you did this as part of the discussion,
> naturally the patch came without a sign-off. Can we consider it
> signed off? Just saying "ok" is fine.Sure:
ok
;-)
I'm also mildly surprised that it ended up being correct, albeit with some extra work from you :-)
--
Thomas Rast
trast@{inf,student}.ethz.ch