Re: Force merge conflicts?

From: Warner Losh <imp_at_bsdimp.com>
Date: Tue, 23 Jan 2024 21:51:51 UTC
On Tue, Jan 23, 2024 at 11:20 AM Mathieu Arnold <mat@freebsd.org> wrote:

> On Tue, Jan 23, 2024 at 03:51:32PM +0100, Christian Weisgerber wrote:
> > Is there a way to tell git to create a conflict when two branches
> > have the same change?
>
> I had a look and Git conflicts' resolution does not seem to be able to
> do that. For Git, when you merge two files that have the same change,
> then it assumes that it is the same change and is happy with it.
>
> For the case you are talking about, I would either:
>
> - Defer the PORTREVISION bump to when the branch is ready to be merged,
>   and automate it with one of the scripts in Tools.
> - Bump PORTREVISON and add a comment on the same line with, say,
>   `# TODO: remove me` so that it forces a conflict to arise and
>   mechanically remove them before merging.
>

Personally, I'd set PORTREVISION to 100 in the branch and merge often. Who
says that
the first bump has to be to 1? If you really want it to be the numerically
next number, bump
it each time there's a conflict, (so 101, 102, 103) then you can look for
those > 100 and
re-adjust. If this has been done before, start at 200, etc. Since there's
nothing wrong with 100,
though, you could do this and land it like that in the main tree.

It's a different variation on the force a conflict ploy though

Warner