Subject: Re: [PATCH v7 1/2] merge-tree.c: add --merge-base=<commit> option

From: Junio C Hamano <[email-masked]>
Date: Tue, 22 Nov 2022 12:04:19 +0900

"Kyle Zhao via GitGitGadget" <[email-masked]> writes:

> +--merge-base=<commit>::
> +	Instead of finding the merge-bases for <branch1> and <branch2>,
> +	specify a merge-base for the merge.

OK.

> +	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.