From: Phillip Wood <phillip.wood123@gmail.com>
To: Alex Henrie <alexhenrie24@gmail.com>,
git@vger.kernel.org, tao@klerks.biz, gitster@pobox.com,
newren@gmail.com, phillip.wood123@gmail.com,
Johannes.Schindelin@gmx.de
Subject: Re: [PATCH 1/2] rebase: add a --rebase-merges=drop option
Date: Mon, 20 Feb 2023 09:31:30 +0000 [thread overview]
Message-ID: <8857003a-f33d-00c5-5e1e-bfbcd60924ae@dunelm.org.uk> (raw)
In-Reply-To: <20230220033224.10400-1-alexhenrie24@gmail.com>
Hi Alex
On 20/02/2023 03:32, Alex Henrie wrote:
> Name the new option "drop" intead of "no" or "false" to avoid confusion > in the future if --rebase-merges grows the ability to truly "rebase"
> merge commits by reusing the conflict resolution information from the
> original merge commit, and we want to add an option to ignore the
> conflict resolution information.
>
> This option can be used to countermand a previous --rebase-merges
> option.
I'm a bit confused as to the reason for this change - what's the
advantage over just saying --no-rebase-merges which already exists?
Best Wishes
Phillip
> Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
> ---
> Documentation/git-rebase.txt | 2 +-
> builtin/rebase.c | 2 +-
> t/t3430-rebase-merges.sh | 30 ++++++++++++++++++++++++++++++
> 3 files changed, 32 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
> index 9a295bcee4..92e90f96aa 100644
> --- a/Documentation/git-rebase.txt
> +++ b/Documentation/git-rebase.txt
> @@ -528,7 +528,7 @@ have the long commit hash prepended to the format.
> See also INCOMPATIBLE OPTIONS below.
>
> -r::
> ---rebase-merges[=(rebase-cousins|no-rebase-cousins)]::
> +--rebase-merges[=(rebase-cousins|no-rebase-cousins|drop)]::
> By default, a rebase will simply drop merge commits from the todo
> list, and put the rebased commits into a single, linear branch.
> With `--rebase-merges`, the rebase will instead try to preserve
> diff --git a/builtin/rebase.c b/builtin/rebase.c
> index 6635f10d52..96c0474379 100644
> --- a/builtin/rebase.c
> +++ b/builtin/rebase.c
> @@ -1436,7 +1436,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
> if (options.exec.nr)
> imply_merge(&options, "--exec");
>
> - if (rebase_merges) {
> + if (rebase_merges && strcmp("drop", rebase_merges)) {
> if (!*rebase_merges)
> ; /* default mode; do nothing */
> else if (!strcmp("rebase-cousins", rebase_merges))
> diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh
> index fa2a06c19f..861c8405f2 100755
> --- a/t/t3430-rebase-merges.sh
> +++ b/t/t3430-rebase-merges.sh
> @@ -250,6 +250,36 @@ test_expect_success 'with a branch tip that was cherry-picked already' '
> EOF
> '
>
> +test_expect_success 'do not rebase merges unless asked' '
> + git checkout -b rebase-merges-default E &&
> + before="$(git rev-parse --verify HEAD)" &&
> + test_tick &&
> + git rebase --rebase-merges C &&
> + test_cmp_rev HEAD $before &&
> + test_tick &&
> + git rebase C &&
> + test_cmp_graph C.. <<-\EOF
> + * B
> + * D
> + o C
> + EOF
> +'
> +
> +test_expect_success 'do not rebase merges when asked to drop them' '
> + git checkout -b rebase-merges-drop E &&
> + before="$(git rev-parse --verify HEAD)" &&
> + test_tick &&
> + git rebase --rebase-merges C &&
> + test_cmp_rev HEAD $before &&
> + test_tick &&
> + git rebase --rebase-merges=drop C &&
> + test_cmp_graph C.. <<-\EOF
> + * B
> + * D
> + o C
> + EOF
> +'
> +
> test_expect_success 'do not rebase cousins unless asked for' '
> git checkout -b cousins main &&
> before="$(git rev-parse --verify HEAD)" &&
next prev parent reply other threads:[~2023-02-20 9:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-20 3:32 [PATCH 1/2] rebase: add a --rebase-merges=drop option Alex Henrie
2023-02-20 3:32 ` [PATCH 2/2] rebase: add a config option for --rebase-merges Alex Henrie
2023-02-20 9:38 ` Phillip Wood
2023-02-20 17:06 ` Alex Henrie
2023-02-20 16:41 ` Elijah Newren
2023-02-20 9:31 ` Phillip Wood [this message]
2023-02-20 17:03 ` [PATCH 1/2] rebase: add a --rebase-merges=drop option Alex Henrie
2023-02-20 21:42 ` Junio C Hamano
2023-02-21 16:08 ` Philip Oakley
2023-02-21 18:42 ` Junio C Hamano
2023-05-13 16:51 ` [PATCH 0/1] cover-letter: flatten Philip Oakley
2023-05-13 16:56 ` [PATCH 1/1] doc: Glossary, describe Flattening Philip Oakley
2023-05-15 6:59 ` Junio C Hamano
2023-05-27 16:28 ` Philip Oakley
2023-05-19 21:35 ` Kristoffer Haugsbakk
2023-05-27 16:46 ` Philip Oakley
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=8857003a-f33d-00c5-5e1e-bfbcd60924ae@dunelm.org.uk \
--to=phillip.wood123@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=alexhenrie24@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=newren@gmail.com \
--cc=phillip.wood@dunelm.org.uk \
--cc=tao@klerks.biz \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).