From: Alex Henrie <alexhenrie24@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git mailing list <git@vger.kernel.org>
Subject: Re: [PATCH] rebase: add a config option for --no-fork-point
Date: Wed, 20 Jan 2021 16:13:35 -0700 [thread overview]
Message-ID: <CAMMLpeQM7JCP0=TMqf0DxDCVJvkCGDEPSKN6vYTU_xc7+QaA1Q@mail.gmail.com> (raw)
In-Reply-To: <xmqqturbdxi2.fsf@gitster.c.googlers.com>
On Wed, Jan 20, 2021 at 4:00 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> Alex Henrie <alexhenrie24@gmail.com> writes:
>
> > @@ -1095,6 +1097,12 @@ static int rebase_config(const char *var, const char *value, void *data)
> > return 0;
> > }
> >
> > + if (!strcmp(var, "rebase.forkpoint")) {
> > + if (!git_config_bool(var, value))
> > + opts->fork_point = 0;
> > + return 0;
> > + }
>
> It is curious that this code seems to deliberatly ignore
>
> [rebase] forkpoint = true
>
> but honors
>
> [rebase] forkpoint = false
>
> Intended? IOW, why isn't this just like this?
>
> if (!strcmp(var, "rebase.forkpoint")) {
> opts->fork_point = git_config_bool(var, value);
> return 0;
> }
>
> > @@ -1306,7 +1314,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
> > const char *gpg_sign = NULL;
> > struct string_list exec = STRING_LIST_INIT_NODUP;
> > const char *rebase_merges = NULL;
> > - int fork_point = -1;
> > struct string_list strategy_options = STRING_LIST_INIT_NODUP;
> > struct object_id squash_onto;
> > char *squash_onto_name = NULL;
> > @@ -1406,7 +1413,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
> > N_("mode"),
> > N_("try to rebase merges instead of skipping them"),
> > PARSE_OPT_OPTARG, NULL, (intptr_t)""},
> > - OPT_BOOL(0, "fork-point", &fork_point,
> > + OPT_BOOL(0, "fork-point", &options.fork_point,
> > N_("use 'merge-base --fork-point' to refine upstream")),
> > OPT_STRING('s', "strategy", &options.strategy,
> > N_("strategy"), N_("use the given merge strategy")),
> > @@ -1494,7 +1501,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
> > die(_("cannot combine '--keep-base' with '--root'"));
> > }
> >
> > - if (options.root && fork_point > 0)
> > + if (options.root && options.fork_point > 0)
> > die(_("cannot combine '--root' with '--fork-point'"));
>
> Is that because of this code?
Yes. I was trying to avoid annoying the user with errors when
rebase.forkPoint is set to "true" and --root is given on the command
line.
> If so, perhaps the configuration parser should set the .fork_point
> to (-1), so that "[rebase] forkpoint = false" that appears in your
> ~/.gitconfig file can be countermanded with "[rebase] forkpoint"
> that is placed in .git/config for one particular project that you do
> not mind using the feature?
That's a great point. I will make that change and resubmit. Thanks!
-Alex
next prev parent reply other threads:[~2021-01-21 0:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-20 4:44 [PATCH] rebase: add a config option for --no-fork-point Alex Henrie
2021-01-20 23:00 ` Junio C Hamano
2021-01-20 23:13 ` Alex Henrie [this message]
2021-01-21 22:27 ` Junio C Hamano
2021-01-21 23:25 ` Alex Henrie
2021-01-21 23:45 ` Denton Liu
2021-01-21 23:51 ` Alex Henrie
2021-02-18 23:29 ` Junio C Hamano
2021-02-20 5:10 ` Alex Henrie
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMMLpeQM7JCP0=TMqf0DxDCVJvkCGDEPSKN6vYTU_xc7+QaA1Q@mail.gmail.com' \
--to=alexhenrie24@gmail.com \
--cc=git@vger.kernel.org \
--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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).