git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v7 5/5] pull: display default warning only when non-ff
Date: Mon, 14 Dec 2020 15:20:39 -0800	[thread overview]
Message-ID: <xmqqmtyg9dq0.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <5fd7d82a9b6ab_d44af208bb@natae.notmuch> (Felipe Contreras's message of "Mon, 14 Dec 2020 15:24:58 -0600")

Felipe Contreras <felipe.contreras@gmail.com> writes:

> 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 ;-)

  reply	other threads:[~2020-12-14 23:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14 20:26 [PATCH v7 0/5] making pull advice not to trigger when unneeded Junio C Hamano
2020-12-14 20:26 ` [PATCH v7 1/5] pull: refactor fast-forward check Junio C Hamano
2020-12-14 20:26 ` [PATCH v7 2/5] pull: give the advice for choosing rebase/merge much later Junio C Hamano
2020-12-14 20:26 ` [PATCH v7 3/5] pull: get rid of unnecessary global variable Junio C Hamano
2020-12-14 20:59   ` Felipe Contreras
2020-12-14 23:16     ` Junio C Hamano
2020-12-15  2:55       ` Felipe Contreras
2020-12-14 20:26 ` [PATCH v7 4/5] pull: correct condition to trigger non-ff advice Junio C Hamano
2020-12-14 21:17   ` Felipe Contreras
2020-12-14 23:19     ` Junio C Hamano
2020-12-15  6:35       ` Felipe Contreras
2020-12-14 20:26 ` [PATCH v7 5/5] pull: display default warning only when non-ff Junio C Hamano
2020-12-14 21:24   ` Felipe Contreras
2020-12-14 23:20     ` Junio C Hamano [this message]
2020-12-15  2:57       ` Felipe Contreras
2020-12-15  6:30 ` [PATCH v7 0/5] making pull advice not to trigger when unneeded Felipe Contreras
2020-12-15 10:58   ` Junio C Hamano
2020-12-15 12:22     ` Felipe Contreras
2020-12-18 20:46       ` Felipe Contreras
2020-12-23 10:04         ` Junio C Hamano
2020-12-23 14:10           ` Felipe Contreras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqmtyg9dq0.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).