Re: [PATCH v1] rebase -m: Use empty tree base for parentless commits
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 9, 2014, 20:18 UTC
- Message-ID
- <xmqqoatl574t.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <5436E83A.7070603@gmail.com>
Fabian Ruch <bafain@gmail.com> writes:
Show 6 quoted lines
>> The interface to "git-merge-$strategy" is designed in such a way >> that each strategy should be capable of taking _no_ base at all. > > The merge strategies "resolve" and "octopus" seem to refuse to run if no > base is specified. The former silently exits if no bases are given and > the latter dies saying "Unable to find common commit".
That just means these two strategies are not prepared to do a merge without base (yet). It does not automatically give license to the caller to pass a random tree as if it is the merge base the user wanted to use.
For "resolve", I think it is OK for it to detect that the caller did not give a common ancestor tree and use an empty tree when merging (which is what merge-recursive ends up doing internally).
I am not offhand sure if the same is sensible for "octopus", though.