git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elijah Newren <newren@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Derrick Stolee <derrickstolee@github.com>,
	Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH] rebase: mark --update-refs as requiring the merge backend
Date: Fri, 20 Jan 2023 08:47:30 -0800	[thread overview]
Message-ID: <CABPp-BHDhpSVpuaubTP=smWaf7FBmpzB-_Frh0Dn5oN+vx0xzw@mail.gmail.com> (raw)
In-Reply-To: <xmqqr0vpxm3d.fsf@gitster.g>

On Fri, Jan 20, 2023 at 7:27 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> Derrick Stolee <derrickstolee@github.com> writes:
>
> >> +    if (options.update_refs)
> >> +            imply_merge(&options, "--update-refs");
> >> +
> >
> > This solution is very elegant. The only downside is the lack of warning
> > if --update-refs was implied by rebase.updateRefs=true, but I'm happy to
> > delay implementing that warning in favor of your complete solution here.
>
> If features A and B are incompatible and both can be specified from
> both command line and configuration, ideally I would expect the
> system to operate in one of two ways.

I agree that one of the two ways you highlight below would be ideal.
Should this series be held up on extending the checks to implement
this ideal, or are you just commenting for whoever later circles back
to implement this?

>  I haven't thought it through
> to decide which one I prefer between the two.
>
>  * Take "command line trumps configuration" one step further, so
>    that A that is configured but not asked for from the command
>    line is defeated by B that is asked for from the command line.
>
>    This way, only when A and B are both requested via the
>    configuration, of via the command line, we'd fail the operation
>    by saying A and B are incompatible.  Otherwise, the one that is
>    configured but overridden is turned off (either silently or with
>    a warning).
>
>  * Declare "command line trumps configuration" is only among the
>    same feature.  Regardless of how features A and B that are
>    incompatible are requested, the command will error out, citing
>    incompatibility.  It would be very nice if the warning mentioned
>    where the requests for features A and B came from (e.g. "You
>    asked for -B from the command line, but you have A configured,
>    and both cannot be active at the same time---disable A from the
>    command line, or do not ask for B")
>
>    When A is configured and B is requested from the command line,
>    the command will error out, and the user must defeat A from the
>    command line before the user can use B, e.g. "git cmd --no-A -B".
>
> A knee-jerk reaction to the situation is that the latter feels
> somewhat safer than the former, but when I imagine the actual end
> user who saw the error message, especially the suggested solution
> "disable A from the command line or do not ask for B from the
> command line", may say "well, I asked for B for this invocation
> explicitly with -B from the command line, and you(Git) should be
> able to make it imply --no-A", which amounts to the same thing as
> the former choice.

If it is clear to the user that A and B preclude each other, then I
agree with this sentiment that the former choice (silently ignoring
the config) would avoid a minor frustration for some users and thus
would be better.  But I don't think that's applicable here.  There is
no reason that --whitespace=fix shouldn't be available from the merge
backend other than that we haven't implemented it yet, and it's likely
feasible to implement --update-refs for the apply backend with enough
effort if we thought it was worth it.  So, if a user sets
rebase.updateRefs=true in their config because they always want
included branches updated, but one time they run `git rebase
--whitespace=fix`, they will likely have a negative experience like
the one that inspired this patch.  Perhaps we're forced to choose
between possible frustration by different end users, but if so, I
think trying to debug and figure out "Wait, I switched to this branch
and started tweaking it but it appears to not have some relevant
changes I'm sure I made to it yesterday.  What happened?" is a much
worse frustration than "I have to manually specify --no-A in this
special case".  So, when it's not at all obvious that A and B preclude
each other, I think we're better off giving the error.

  reply	other threads:[~2023-01-20 16:47 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19  5:36 [PATCH] rebase: mark --update-refs as requiring the merge backend Elijah Newren via GitGitGadget
2023-01-19 21:47 ` Derrick Stolee
2023-01-20  1:54   ` Elijah Newren
2023-01-20 15:27   ` Junio C Hamano
2023-01-20 16:47     ` Elijah Newren [this message]
2023-01-20  4:56 ` [PATCH v2 0/2] " Elijah Newren via GitGitGadget
2023-01-20  4:56   ` [PATCH v2 1/2] rebase: remove completely useless -C option Elijah Newren via GitGitGadget
2023-01-20  5:40     ` Eric Sunshine
2023-01-20  6:42       ` Elijah Newren
2023-01-20  9:55     ` Martin Ågren
2023-01-20 15:32       ` Elijah Newren
2023-01-20 12:05     ` Junio C Hamano
2023-01-20 15:31       ` Elijah Newren
2023-01-20 16:15         ` Junio C Hamano
2023-01-21  4:52           ` Elijah Newren
2023-01-22  0:02             ` Junio C Hamano
2023-01-20  4:56   ` [PATCH v2 2/2] rebase: mark --update-refs as requiring the merge backend Elijah Newren via GitGitGadget
2023-01-20 16:46     ` Phillip Wood
2023-01-21  1:34       ` Elijah Newren
2023-01-21  1:55   ` [PATCH v3 0/7] rebase: fix several code/testing/documentation issues around flag incompatibilities Elijah Newren via GitGitGadget
2023-01-21  1:55     ` [PATCH v3 1/7] rebase: mark --update-refs as requiring the merge backend Elijah Newren via GitGitGadget
2023-01-21  1:55     ` [PATCH v3 2/7] rebase: flag --apply and --merge as incompatible Elijah Newren via GitGitGadget
2023-01-21  1:55     ` [PATCH v3 3/7] rebase: remove --allow-empty-message from incompatible opts Elijah Newren via GitGitGadget
2023-01-21 15:09       ` Phillip Wood
2023-01-21  1:55     ` [PATCH v3 4/7] rebase: fix docs about incompatibilities with --root Elijah Newren via GitGitGadget
2023-01-21  1:55     ` [PATCH v3 5/7] rebase: add coverage of other incompatible options Elijah Newren via GitGitGadget
2023-01-21 15:20       ` Phillip Wood
2023-01-21 19:25         ` Phillip Wood
2023-01-22  5:11           ` Elijah Newren
2023-01-21  1:55     ` [PATCH v3 6/7] rebase: clarify the OPT_CMDMODE incompatibilities Elijah Newren via GitGitGadget
2023-01-21  1:55     ` [PATCH v3 7/7] rebase: fix formatting of rebase --reapply-cherry-picks option in docs Elijah Newren via GitGitGadget
2023-01-21 15:21       ` Phillip Wood
2023-01-22  6:12     ` [PATCH v4 0/9] rebase: fix several code/testing/documentation issues around flag incompatibilities Elijah Newren via GitGitGadget
2023-01-22  6:12       ` [PATCH v4 1/9] rebase: mark --update-refs as requiring the merge backend Elijah Newren via GitGitGadget
2023-01-22  6:12       ` [PATCH v4 2/9] rebase: flag --apply and --merge as incompatible Elijah Newren via GitGitGadget
2023-01-22  6:12       ` [PATCH v4 3/9] rebase: remove --allow-empty-message from incompatible opts Elijah Newren via GitGitGadget
2023-01-22  6:12       ` [PATCH v4 4/9] rebase: fix docs about incompatibilities with --root Elijah Newren via GitGitGadget
2023-01-22  6:12       ` [PATCH v4 5/9] rebase: add coverage of other incompatible options Elijah Newren via GitGitGadget
2023-01-23 20:08         ` Phillip Wood
2023-01-24  2:36           ` Elijah Newren
2023-01-24 10:27             ` Phillip Wood
2023-01-24 13:16               ` Phillip Wood
2023-01-24 14:48                 ` Junio C Hamano
2023-01-24 15:41                 ` Elijah Newren
2023-01-24 16:48                   ` Phillip Wood
2023-01-24 17:12                     ` Elijah Newren
2023-01-24 19:21                       ` Phillip Wood
2023-01-22  6:12       ` [PATCH v4 6/9] rebase: clarify the OPT_CMDMODE incompatibilities Elijah Newren via GitGitGadget
2023-01-22  6:12       ` [PATCH v4 7/9] rebase: fix formatting of rebase --reapply-cherry-picks option in docs Elijah Newren via GitGitGadget
2023-01-22  6:12       ` [PATCH v4 8/9] rebase: put rebase_options initialization in single place Elijah Newren via GitGitGadget
2023-01-22  6:12       ` [PATCH v4 9/9] rebase: provide better error message for apply options vs. merge config Elijah Newren via GitGitGadget
2023-01-23 15:56       ` [PATCH v4 0/9] rebase: fix several code/testing/documentation issues around flag incompatibilities Derrick Stolee
2023-01-24  2:05         ` Elijah Newren
2023-01-25  4:03       ` [PATCH v5 00/10] " Elijah Newren via GitGitGadget
2023-01-25  4:03         ` [PATCH v5 01/10] rebase: mark --update-refs as requiring the merge backend Elijah Newren via GitGitGadget
2023-01-25  4:03         ` [PATCH v5 02/10] rebase: flag --apply and --merge as incompatible Elijah Newren via GitGitGadget
2023-01-25  4:03         ` [PATCH v5 03/10] rebase: remove --allow-empty-message from incompatible opts Elijah Newren via GitGitGadget
2023-01-25  4:03         ` [PATCH v5 04/10] rebase: fix docs about incompatibilities with --root Elijah Newren via GitGitGadget
2023-01-25  4:03         ` [PATCH v5 05/10] rebase: fix incompatiblity checks for --[no-]reapply-cherry-picks Elijah Newren via GitGitGadget
2023-01-25 14:14           ` Phillip Wood
2023-01-25  4:03         ` [PATCH v5 06/10] rebase: add coverage of other incompatible options Elijah Newren via GitGitGadget
2023-01-25  4:03         ` [PATCH v5 07/10] rebase: clarify the OPT_CMDMODE incompatibilities Elijah Newren via GitGitGadget
2023-01-25  4:03         ` [PATCH v5 08/10] rebase: fix formatting of rebase --reapply-cherry-picks option in docs Elijah Newren via GitGitGadget
2023-01-25  4:03         ` [PATCH v5 09/10] rebase: put rebase_options initialization in single place Elijah Newren via GitGitGadget
2023-01-25  4:03         ` [PATCH v5 10/10] rebase: provide better error message for apply options vs. merge config Elijah Newren via GitGitGadget
2023-01-25 14:17         ` [PATCH v5 00/10] rebase: fix several code/testing/documentation issues around flag incompatibilities Phillip Wood
2023-01-25 16:39         ` Junio C Hamano
2023-01-25 16:48           ` Elijah Newren
2023-02-02 10:29         ` rebase --merge vs --whitespace=fix, was " Johannes Schindelin
2023-02-02 23:48           ` Elijah Newren

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='CABPp-BHDhpSVpuaubTP=smWaf7FBmpzB-_Frh0Dn5oN+vx0xzw@mail.gmail.com' \
    --to=newren@gmail.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    /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).