From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.bugs Subject: bug#69220: [PATCH] smerge-mode: add a function to resolve all conflicts in a file Date: Mon, 19 Feb 2024 15:38:51 +0300 Message-ID: References: <865xykr79f.fsf@gnu.org> <0f2cffca61b65ef7c0bd65e3029068d05d64b513.camel@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16724"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.50.3 Cc: Eli Zaretskii , Stefan Monnier , 69220@debbugs.gnu.org To: Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 19 13:39:57 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rc2w8-00049T-KF for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Feb 2024 13:39:56 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rc2vv-0004Ll-BJ; Mon, 19 Feb 2024 07:39:43 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rc2vt-0004GP-Nn for bug-gnu-emacs@gnu.org; Mon, 19 Feb 2024 07:39:41 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rc2vt-0005ek-Cs for bug-gnu-emacs@gnu.org; Mon, 19 Feb 2024 07:39:41 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rc2wE-0001P9-Du for bug-gnu-emacs@gnu.org; Mon, 19 Feb 2024 07:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Feb 2024 12:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69220 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 69220-submit@debbugs.gnu.org id=B69220.17083463615334 (code B ref 69220); Mon, 19 Feb 2024 12:40:02 +0000 Original-Received: (at 69220) by debbugs.gnu.org; 19 Feb 2024 12:39:21 +0000 Original-Received: from localhost ([127.0.0.1]:40599 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rc2vY-0001Ny-OR for submit@debbugs.gnu.org; Mon, 19 Feb 2024 07:39:21 -0500 Original-Received: from forward502b.mail.yandex.net ([178.154.239.146]:42664) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rc2vV-0001No-E7 for 69220@debbugs.gnu.org; Mon, 19 Feb 2024 07:39:19 -0500 Original-Received: from mail-nwsmtp-smtp-production-main-24.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-24.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:c022:0:640:bf6e:0]) by forward502b.mail.yandex.net (Yandex) with ESMTPS id 1E1E55EB92; Mon, 19 Feb 2024 15:38:54 +0300 (MSK) Original-Received: by mail-nwsmtp-smtp-production-main-24.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id qcPItwDOkGk0-SrM3JEIe; Mon, 19 Feb 2024 15:38:53 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1708346333; bh=hOwmQDu2il+5ZcWGj2jQpYe6T5JTxuiPm2WOHmAjrV4=; h=References:Date:In-Reply-To:Cc:To:From:Subject:Message-ID; b=hPLIbSkXPtd4bM3FKqMo3jow/Q7dtYB5Q7q1C7vCUcodS3pdN77EI0NYC4bu4rtd2 NNfn7lIJhYPcPKkG2uf48EZpB2nUbF/noMtwt22Tc2gy2YqfQNz9ozs0hPy85kNBBf W2vT8p5hHrcCf7kDiC9OlV8S5JBOnS5f8wfjv0aM= Authentication-Results: mail-nwsmtp-smtp-production-main-24.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280256 Archived-At: On Mon, 2024-02-19 at 13:33 +0100, Andreas Schwab wrote: > On Feb 19 2024, Konstantin Kharlamov wrote: > > > On Mon, 2024-02-19 at 13:25 +0100, Andreas Schwab wrote: > > > On Feb 19 2024, Konstantin Kharlamov wrote: > > > > > > > 1: Actually, git provides a functional that should work for > > > > that > > > > usecase; but in my experience it is more confusing than it's > > > > useful. It > > > > is options `--theirs/ours`, i.e. `git checkout --theirs ./` and > > > > `git > > > > checkout --ours ./`. But these options are problematic because > > > > instead > > > > of resolving conflict in preference of `theirs` or `ours` they > > > > do a > > > > complete checkout of the code from either of the branches. I > > > > can't > > > > count how many times I was burned by trying to resolve > > > > conflicts > > > > with > > > > these options and then was getting wrong code because together > > > > with > > > > the > > > > conflicting part the options change everything else. > > > > > > I think what you actually want is the 'ours'/'theirs' options of > > > the > > > merge strategy (available to both the ort and recursive > > > strategies). > > > > Oh, thanks for mentioning, I didn't know! So=E2=80=A6 how do I use them= ? > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 -X , --strategy-opt= ion=3D > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Pass the through to the merge strategy. > This > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 implies --me= rge and, if no strategy has been specified, -s > ort. > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Note the rev= ersal of ours and theirs as noted above for > the -m > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 option. > Sorry, I'm not following. So, I just created an artificial conflict. Then I get these errors: =CE=BB git merge -X theirs error: Merging is not possible because you have unmerged files. hint: Fix them up in the work tree, and then use 'git add/rm ' hint: as appropriate to mark resolution and make a commit. fatal: Exiting because of an unresolved conflict. =CE=BB git add -u =CE=BB git merge -X theirs fatal: No current branch.