Re: [PATCH v7 1/2] merge-tree.c: add --merge-base=<commit> option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 22, 2022, 03:04 UTC
- Message-ID
- <xmqqsfibsn9o.fsf@gitster.g>
- In-Reply-To
- <1cf1c69b8e8e8e81eccc42b5d8efc605a36ab7eb.1668210314.git.gitgitgadget@gmail.com>
"Kyle Zhao via GitGitGadget" <gitgitgadget@gmail.com> writes:
> +--merge-base=<commit>:: > + Instead of finding the merge-bases for <branch1> and <branch2>, > + specify a merge-base for the merge.
OK.
Show 14 quoted lines
> + const char *merge_base = NULL;
>
> const char * const merge_tree_usage[] = {
> N_("git merge-tree [--write-tree] [<options>] <branch1> <branch2>"),
> @@ -515,6 +533,10 @@ int cmd_merge_tree(int argc, const char **argv, const char *prefix)
> &o.use_stdin,
> N_("perform multiple merges, one per line of input"),
> PARSE_OPT_NONEG),
> + OPT_STRING(0, "merge-base",
> + &merge_base,
> + N_("commit"),
> + N_("specify a merge-base for the merge")),
> OPT_END()
> };This looks wrong, though.
Shouldn't "git merge-tree --merge-base=X --merge-base=Y A B" allow you to compute the merge between A and B in a history where there are two merge bases?
Unfortunately this is already in 'next', so let's see an incremental fix on top.
Thanks.