Re: [PATCH v7 5/5] pull: display default warning only when non-ff
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 14, 2020, 23:20 UTC
- Message-ID
- <xmqqmtyg9dq0.fsf@gitster.c.googlers.com>
- In-Reply-To
- <5fd7d82a9b6ab_d44af208bb@natae.notmuch>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 21 quoted lines
> Junio C Hamano wrote:
>> @@ -1044,7 +1045,9 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
>> if (opt_rebase && merge_heads.nr > 1)
>> die(_("Cannot rebase onto multiple branches."));
>>
>> - if (rebase_unspecified && !opt_ff) {
>> + can_ff = get_can_ff(&orig_head, &merge_heads.oid[0]);
>> +
>> + if (rebase_unspecified && !opt_ff && !can_ff) {
>> if (opt_verbosity >= 0)
>> show_advice_pull_non_ff();
>> }
>
> I strongly predict the conditionals will end up looking similar to:
>
> if (!can_ff) {
> if (rebase_unspecified && !opt_ff && opt_verbosity >= 0)
> show_advice_pull_non_ff();
> }
>
> But OK.I may have failed to mention this in the cover letter, but I think the placement of opt_ff in this part of the logic needs to be rethought, so I strongly predict that this part will have to further change ;-)