Hello,

On Tue 05 May 2020 at 12:19PM +01, Ian Jackson wrote:

> I think git has pretty much always wanted --allow-unrelated-histories
> for this situation.  The safety catch is there to stop you
> accidentally making a frankenproject, but that doesn't apply here.

Actually only since 2016 (git 2.9).

> If the upstream directory had a debian/ directory I think this rune
> will do something strange to the resulting debian/.  In the general
> case I think the merge algorithm with unrelated histories is not
> correct for upstream files either; eg if you have made changes to
> upstream files something might go wrong.
>
> My approach in these situations is:
>   1. make a branch of the Debian package of the old upstream
>      (ie that has the contents corresponding to the Debian
>      package of the old upstream) but which has the right
>      upstream as an ancestor.
>          git merge -s ours --allow-unrelated-histories v0.14.0
>   2. git merge will now DTRT if we git merge v0.14.1 and do
>      a three-way merge

Is this what you mean:

% dgit clone libopencsd
% cd libopencsd
% # add and fetch upstream remote
% git merge -s ours --allow-unrelated-histories v0.14.0
% git merge v0.14.1

This is better than my patch.  If you could confirm, I can prepare a new
patch.

-- 
Sean Whitton

Attachment: signature.asc
Description: PGP signature

Reply via email to