Re: Force merge conflicts?
- In reply to: Warner Losh : "Re: Force merge conflicts?"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 24 Jan 2024 10:47:45 UTC
Hello all; On 1/23/2024 3:51 PM, Warner Losh wrote: > 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 An alternative: don't touch the PORTREVISION until your PR is ready to be merged. You can merge all day long and not cause a conflict on this one line.