From nobody Wed Jan 24 10:47:45 2024 X-Original-To: freebsd-git@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TKgdx5zhPz581ZT for ; Wed, 24 Jan 2024 10:47:49 +0000 (UTC) (envelope-from unitrunker@gmail.com) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TKgdw63cYz4Fw6 for ; Wed, 24 Jan 2024 10:47:48 +0000 (UTC) (envelope-from unitrunker@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=CuOLio1p; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of unitrunker@gmail.com designates 2607:f8b0:4864:20::832 as permitted sender) smtp.mailfrom=unitrunker@gmail.com Received: by mail-qt1-x832.google.com with SMTP id d75a77b69052e-429985e952bso28408291cf.3 for ; Wed, 24 Jan 2024 02:47:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706093268; x=1706698068; darn=freebsd.org; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=bdY5PkxQL68mWw0emxCX0gwmThgU1edzDut3OdsVYLg=; b=CuOLio1p+MlKOucDt623G9PSte7nz+fRLc7wukAVFbeDV+Utp+bea8RvkxLoHy2+sb z2fnpTNC7dF1GW+A2l6K880XW57XOpLc2yyT+6xg90lRjViaCrd6gHz6hlpr5yazmZkl ZcP8tsDk36ln6DKT7rCki+egEDKYr7v6YCctRaqkUfgorfcAdX/pPLwccEXIHg3b3xIy fGGkItWMaWfwMwnw2Jro0fX6OW90BaLiDpV+aNdxcB5X/FZDHjcVxpULqyaPCXgBwLKe i+NRGXTleWIOjwUODcOib2Ft6CL802i3Y3a4BCd/qbLoA03Yr4BPT5y7PliN3XEv8k7M TmBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706093268; x=1706698068; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=bdY5PkxQL68mWw0emxCX0gwmThgU1edzDut3OdsVYLg=; b=gLt/c3763NkU+V9jwiJC7mbgcW1zGeTTOQWNdK9ry5ls1ZyCO2w6pcvnDFx3L/LZLb lK38hF7UUh/D4MKhanWZSPZIQPFmJgpu/36nHsSaaEpizdGobgCU7IO9os4zvtjb/Del vMSTKdNUvF3NNAMTyaaS5CfmqB9y1CJOdcN4fwz2+dCsCARqIRXFmiTjtbHO+m9igwMr aqgB4hnX/bgJfrBiYefoxRvabetUNyQbuVeqdCJFKAi4q8lGNGzszX2LX8r2gIFgKpAo l6PbpcUNrBt1w2rrR5+crw//6Fk88ygcTHjxf5pewFO0rVVwlHbpLEmmGMJC6/33ym0P J5dQ== X-Gm-Message-State: AOJu0Yx5oo60WS9w3tZiEhEebL3W6Lxp0q3/MWoduaaAn8hcur+rqQIv ZH99abwOybPcjjfwmli6GjVmnbXa8YH/I7xG5EKSiCCNgamOKe6avKjk2yxz X-Google-Smtp-Source: AGHT+IFmB91dLA49Zvn0V/5KtBhvfgghSHZhI44LVnVLDKSTIvhsDpqd0SffBzYWzNIFBeTxirUwpA== X-Received: by 2002:ac8:7250:0:b0:42a:505c:7d02 with SMTP id l16-20020ac87250000000b0042a505c7d02mr1833110qtp.43.1706093268109; Wed, 24 Jan 2024 02:47:48 -0800 (PST) Received: from [172.16.0.31] (72-48-20-199.dyn.grandenetworks.net. [72.48.20.199]) by smtp.gmail.com with ESMTPSA id x13-20020ac8730d000000b004283695a39bsm4260965qto.94.2024.01.24.02.47.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 Jan 2024 02:47:47 -0800 (PST) Content-Type: multipart/alternative; boundary="------------K6AjY00nB7m3rNpYPoC1H96e" Message-ID: <1a6cf9f5-73b1-4ad5-a6d6-efaa72f5a193@gmail.com> Date: Wed, 24 Jan 2024 04:47:45 -0600 List-Id: Discussion of git use in the FreeBSD project List-Archive: https://lists.freebsd.org/archives/freebsd-git List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-git@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Force merge conflicts? Content-Language: en-US To: freebsd-git@freebsd.org References: From: Unit Runker In-Reply-To: X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.99 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; XM_UA_NO_VERSION(0.01)[]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_HAS_DN(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; PREVIOUSLY_DELIVERED(0.00)[freebsd-git@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-git@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::832:from] X-Rspamd-Queue-Id: 4TKgdw63cYz4Fw6 This is a multi-part message in MIME format. --------------K6AjY00nB7m3rNpYPoC1H96e Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hello all; On 1/23/2024 3:51 PM, Warner Losh wrote: > On Tue, Jan 23, 2024 at 11:20 AM Mathieu Arnold 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. --------------K6AjY00nB7m3rNpYPoC1H96e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

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.

--------------K6AjY00nB7m3rNpYPoC1H96e--