From nobody Tue Jan 23 14:51:32 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 4TK99k35QJz56yVD for ; Tue, 23 Jan 2024 14:55:06 +0000 (UTC) (envelope-from naddy@mips.inka.de) Received: from mail.inka.de (mail.inka.de [IPv6:2a04:c9c7:0:1073:217:a4ff:fe3b:e77c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4TK99j4R7Dz4VLT for ; Tue, 23 Jan 2024 14:55:05 +0000 (UTC) (envelope-from naddy@mips.inka.de) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of naddy@mips.inka.de has no SPF policy when checking 2a04:c9c7:0:1073:217:a4ff:fe3b:e77c) smtp.mailfrom=naddy@mips.inka.de Received: from mips.inka.de (naddy@[127.0.0.1]) by mail.inka.de with uucp (rmailwrap 0.5) id 1rSIB6-00D4To-Cs; Tue, 23 Jan 2024 15:55:04 +0100 Received: from lorvorc.mips.inka.de (localhost [127.0.0.1]) by lorvorc.mips.inka.de (8.17.1/8.17.1) with ESMTP id 40NEpWQa018167 for ; Tue, 23 Jan 2024 15:51:32 +0100 (CET) (envelope-from naddy@lorvorc.mips.inka.de) Received: (from naddy@localhost) by lorvorc.mips.inka.de (8.17.1/8.17.1/Submit) id 40NEpWeA018166 for freebsd-git@freebsd.org; Tue, 23 Jan 2024 15:51:32 +0100 (CET) (envelope-from naddy) Date: Tue, 23 Jan 2024 15:51:32 +0100 From: Christian Weisgerber To: freebsd-git@freebsd.org Subject: Force merge conflicts? Message-ID: 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spamd-Bar: - X-Spamd-Result: default: False [-1.10 / 15.00]; AUTH_NA(1.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_MATCH_FROMTLD(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:202113, ipnet:2a04:c9c7::/32, country:DE]; MIME_TRACE(0.00)[0:+]; FREEFALL_USER(0.00)[naddy]; MISSING_XM_UA(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; MLMMJ_DEST(0.00)[freebsd-git@freebsd.org]; ARC_NA(0.00)[]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_DKIM_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-git@freebsd.org]; DMARC_NA(0.00)[inka.de]; R_SPF_NA(0.00)[no SPF record] X-Rspamd-Queue-Id: 4TK99j4R7Dz4VLT Say, you create a branch of the ports tree to work on something that touches a number of ports (like arrowd@'s current autotools-mandir project). You accumulate changes and bump PORTREVISION in various port Makefiles. Meanwhile work on the "main" branch continues and PORTREVISION also gets bumped for entirely different reasons. Now when you rebase/merge your changes into "main", git is happy that the PORTREVISION line is the same in both branches and silently unifies this. Unfortunately, your incoming changes should _increment_ PORTREVISION, but that increment is now silently lost. Is there a way to tell git to create a conflict when two branches have the same change? -- Christian "naddy" Weisgerber naddy@mips.inka.de From nobody Tue Jan 23 18:20:07 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 4TKFkM3C5vz57qL1 for ; Tue, 23 Jan 2024 18:20:11 +0000 (UTC) (envelope-from mat@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TKFkM2fGMz4JNP; Tue, 23 Jan 2024 18:20:11 +0000 (UTC) (envelope-from mat@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706034011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ltAIBpz7rYL2lUdFB7sNcm5R3atFixwNB2SI37JkhLs=; b=iOxlX3OzUBdM+NBorZIDpRLQz+JErC1HKjzt1riIBPmAQE1v2FuiGlJGoXGu/CyfEFfLWS C7i/dV3XX1e41i7o3+f3psZtB906zQtfvcqPUb0LIp8dIsmjHBHLGMU3bFAveWuL2uGq1f QeEplR76pnWSYlvqKfopHKLhXFRJ/6AUnpTwfDWf4caJ4oDc6syZTqKQDfhWr6uZpSpeaG RN4KJxPwchf6kWNlBnwOZEAWbGVQTWYXT6/EIS1ahTgOE1+sbc5W/OfuZ5JiX42FrL1F9C eapk3ZOgDBFOZ6eiI+QqGznG+4afUjEa9nAroz2Fl5rBrBNtSSfBtXWKKiOncQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706034011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ltAIBpz7rYL2lUdFB7sNcm5R3atFixwNB2SI37JkhLs=; b=kV549wpaPuoiBsmsN4gcq05xqzdqYZ4B63dITjyjJYCPb/IN0wuRK1MiR6YsorliD8WNFy q53l57DwhM+TqJ8ViMITRnMB5+fotyuMrCt8lXbOYbosvB4cN3rKmelsH6LDbrIS85bU8P btFEAOHVrav1MSiYx/vaiQlG1sXRKE0oRECBGy+DZT6c1A99pWtaaDI9tV1DEzWdI4wfvL MO0kiv9BOp2umo+/1KDrUNSMUlIbR224yl5XpBo3Bt5byK0uuX9U4u1r9sIdF3MOVrtaDx graqMmxPhi4706v3ORbY0RUtfUB0mbrOFV+ZXljOPqZnPFX2z5mZy5UCmXZzxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706034011; a=rsa-sha256; cv=none; b=jzDphxAnmmREUSl/P6iJ2hW9/wZyJsGdTdsvzJI4rm5V2tiBQH6WqoyoYXc7ENKspyHNXD ATyca1HU6yOKGX8OR3pzGLQCiWC/koOsEtat0XE0N1z65P43ZiE1fm84kUVVRKhG+tfUqa v9xocJRLI25Uel38v3LExyt12NQGAYNcHNUx4gZ2U+hI5MhfsmGzhm5OwuhVyQBl7yjOo7 Go0ZOsDWLYacHL3umbrzULj4SKxsYw1yQ89sT0xOEjo9yOPFuuX4A5Y1WDiJzfgEBt14fn awGPGUGBEoLXhYnMxxy9MiutUQSX7i0oDKNJjxcfbJZr5RpB71FVC1GgMdDGiw== Received: from relay.mat.cc (cow.mat.cc [IPv6:2a01:678:2:200::49]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "cow.mat.cc", Issuer "R3" (verified OK)) (Authenticated sender: mat/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4TKFkM0xjhz1Nly; Tue, 23 Jan 2024 18:20:11 +0000 (UTC) (envelope-from mat@freebsd.org) Received: from aching.in.mat.cc (unknown [IPv6:2a01:e0a:836:f670:1073:8017:b029:e606]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by relay.mat.cc (Postfix) with ESMTPSA id 9E6291FDBC; Tue, 23 Jan 2024 19:20:09 +0100 (CET) Date: Tue, 23 Jan 2024 19:20:07 +0100 From: Mathieu Arnold To: Christian Weisgerber Cc: freebsd-git@freebsd.org Subject: Re: Force merge conflicts? Message-ID: References: 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 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="d6h6awwtzsobfxx6" Content-Disposition: inline In-Reply-To: --d6h6awwtzsobfxx6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. --=20 Mathieu Arnold --d6h6awwtzsobfxx6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQITBAABCgB9FiEE9XJBpJetWizkEBUef2IOCp6dQb4FAmWwA1ZfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEY1 NzI0MUE0OTdBRDVBMkNFNDEwMTUxRTdGNjIwRTBBOUU5RDQxQkUACgkQf2IOCp6d Qb4m5AwAm+voGtFVLI/XHcygYWPwFdEbvLuWit0QQgJoJbHlewhxrj10b7ETAyVz geB7Z95KERoc3llvvJkYVqDgyETcokmKHGuviLyNnYwyxluWVzwyQu8hCjBaSXMa 0Jg4/xwcs6jF37jxd2xm0y9YI6Xvpfof+s3KGmlX6Fs3mPCwXvOl1CSpgbOhHKI2 KPjU7paqTKdq0i90/ANo9OdDsDAa7fQhTv9qxwzlTQcvgpKkOECiV2RGwYMofVHc LPsbJHGdZIq+eEmF+3tpLoBU+ay6nRC8JBc8PowkwV8ambs+uib84LUOVxn3ZLZO zsqwXu1ez8WUoZhrjKtszVZaPICntLKS0I89528f/15t2Vkrup4ig0jzrg2Y1rV7 7XGOVBMJDXdQw+LhcUUAb7yJ/nixFogF/fKjjy9TC4a4NJSNn4sqiIk0PLTaD2Cz UPwgheN6/XypU8ceriLtNzfy3nvGsGOed1gbZ3ejG0lFvExmb92kyGgzZMP/VRPu 9KdKlVoa =jolS -----END PGP SIGNATURE----- --d6h6awwtzsobfxx6-- From nobody Tue Jan 23 21:51:51 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 4TKLQq72yzz58DcJ for ; Tue, 23 Jan 2024 21:52:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (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 4TKLQq2cflz4p1w for ; Tue, 23 Jan 2024 21:52:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-55a90b2b554so3589727a12.1 for ; Tue, 23 Jan 2024 13:52:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1706046722; x=1706651522; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=jz15TVbOsX2+c37JIRDNUEhmlyUvqks0LFt31/N0UVc=; b=R4Orz/DOFUu7lH8gv/sMxUUS412cUWHKl1VBIr0f0Z3Phv3k+Zt5Hb7AUpJF47HC67 gVQifvOjEgLbf4lNCVewJla08WKX6JgpNmvvWWebB+lo1KZxnkUrc9VPlYXkjhdbDT+9 X/3VVqGAzK+msA9IAleN1l9cE9PS5AGOIzzwo6zhTIionWkXzI2VXaPphY4V7vrvvuoW dpD2u/5TJ54SivruqZjlx4febig997KUugb9ae1LhnHGcMvUtQA+LdMoDPs3cn4v0AuM YtMqkhBlGOcvqyz9GHWTU2+nF7AyQ0QKL3f9tTo2S0OL+qLw/Ap2Dlb/dFEfxrrSz8Ew gemg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706046722; x=1706651522; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jz15TVbOsX2+c37JIRDNUEhmlyUvqks0LFt31/N0UVc=; b=nl7byehsYVctvWJ7/3FQwAcpFvbwjk9eu0zNIrv03KE4q32vD1BiFKN55dA3vUHiTv YFCIAoH9gDXUOzG9N1siBSE7ZQrJuQZhISjitxwh1Dp3LoXEX0vW3q5TZ6htfOdmcVez AqcwR/b9V8qH4UcXZpwB+BFOojqYOiMhwd/lifS+6P+59FbaxHINTB95aYG43gd5RVQV U9A6oX914UOKhQ+1K+N2RjipGiSM1UE61LlQ81wAji8WbwwoKUm4No9lksZXIb2VKpmr gp/Tw66Hl81SFyuv9gfm7oJkoWQrZYKWHu3/ohIebRFFrQHy8yHj9NQaXLudVnjlrCPo 2UCQ== X-Gm-Message-State: AOJu0YxXyP8e6NhXe7RvDQijhAk9buKo5lnm2f/8I9s9v/K0Drm1Eigt CFX84bDQxuQmdfC7PAgVEF9c8lxjir3SRiQCtf340xKzkVGviBNfmEFkwTgOnD6Wz0+COXJiQT6 Vs6gJYXVWUUfOLHovTkCNDra995x0THdcwEDojdX/ZjoGBb5zq5A= X-Google-Smtp-Source: AGHT+IFiDyEWroR/Ag37Ckak3ajYLAnTiXwdLQvfUhOLgu5OONTjC1ELRjznSjlWDhc111jiK3YtU6DaxmKK3Rh3lhs= X-Received: by 2002:a05:6402:50d3:b0:55c:7e63:38b1 with SMTP id h19-20020a05640250d300b0055c7e6338b1mr1247489edb.35.1706046721982; Tue, 23 Jan 2024 13:52:01 -0800 (PST) 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 References: In-Reply-To: From: Warner Losh Date: Tue, 23 Jan 2024 14:51:51 -0700 Message-ID: Subject: Re: Force merge conflicts? To: Mathieu Arnold Cc: Christian Weisgerber , freebsd-git@freebsd.org Content-Type: multipart/alternative; boundary="000000000000d594f2060fa3f43f" X-Rspamd-Queue-Id: 4TKLQq2cflz4p1w X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] --000000000000d594f2060fa3f43f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 23, 2024 at 11:20=E2=80=AFAM Mathieu Arnold w= rote: > 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 --000000000000d594f2060fa3f43f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, Jan 23, 2024 at 11:20=E2=80= =AFAM 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<= br> 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,
=C2=A0 and automate it with one of the scripts in Tools.
- Bump PORTREVISON and add a comment on the same line with, say,
=C2=A0 `# TODO: remove me` so that it forces a conflict to arise and
=C2=A0 mechanically remove them before merging.

Personally, I'd set PORTREVISION to 100 in the branch and merg= e often. Who says that
the first bump has to be to 1? If you real= ly want it to be the numerically next number, bump
it each time t= here'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, et= c. 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
--000000000000d594f2060fa3f43f-- 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--