From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Whitton Newsgroups: gmane.emacs.bugs Subject: bug#60126: 30.0.50; vc-git-checkin: Offer to unstage conflicting changes Date: Tue, 20 Dec 2022 10:04:34 -0700 Message-ID: <87h6xqgg65.fsf@melete.silentflame.com> References: <38d4d719-8f3c-9bb6-b141-f7e9ca66333c@yandex.ru> <871qovjabq.fsf@melete.silentflame.com> <4513ac99-76d1-cdd6-fcc9-59208b5002f3@yandex.ru> <87zgbih8wv.fsf@melete.silentflame.com> <392bbde0-9d6e-83c4-0639-af406e279ef1@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3754"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 60126@debbugs.gnu.org, juri@linkov.net To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 20 19:40:40 2022 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 1p7hXa-0000lz-Af for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Dec 2022 19:40:40 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7g70-0000Cq-Am; Tue, 20 Dec 2022 12:09:06 -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 1p7g6x-0000Bd-70 for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2022 12:09:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p7g6w-000246-BN for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2022 12:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p7g6w-00073Q-6I for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2022 12:09:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Dec 2022 17:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60126 X-GNU-PR-Package: emacs Original-Received: via spool by 60126-submit@debbugs.gnu.org id=B60126.167155609727106 (code B ref 60126); Tue, 20 Dec 2022 17:09:02 +0000 Original-Received: (at 60126) by debbugs.gnu.org; 20 Dec 2022 17:08:17 +0000 Original-Received: from localhost ([127.0.0.1]:46029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7g69-000738-5K for submit@debbugs.gnu.org; Tue, 20 Dec 2022 12:08:16 -0500 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:57773) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7g2n-00070J-GF for 60126@debbugs.gnu.org; Tue, 20 Dec 2022 12:08:11 -0500 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 209F65C0143; Tue, 20 Dec 2022 12:04:36 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 20 Dec 2022 12:04:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1671555876; x=1671642276; bh=qQ TymcIEF1MhZEZaWAvKs8KRGjcDqp7Zicp4M6CFRfA=; b=gbZrWtpiALP5/rhgfZ RGxa4S/aD1esd7LzCQP3F5+acZBWyyUA5AEZF/ocyKr5W6g9WRC1MaTo7/iLsLWm Je1B3OQUHNeRTAikqVUPfWxcVm1qsZ2BujAQUgqS/lZmIM9lAdIuFUYkhaFPsc1e qi+Ljca3y43ZrSOVGpHCzPGZbSPtWYv4XKpCFrGWcI8hA/Z36k+PiF6CZ22OqFbg cFuD+mSzPjIDY1zzockn/rb1OyYfWc7hqccLST+hjAkRx7YpubEQKykFsbiaTZHW stJ2WVudt5Cpoz0XySTJ2enDvq4WmfAdYF5nmIKUDbT3cvxtQuWTzSNbXzXeVMZE F8zw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1671555876; x=1671642276; bh=qQTymcIEF1MhZEZaWAvKs8KRGjcD qp7Zicp4M6CFRfA=; b=VAKvnAUDBb6IrJtdGYwkkc5xt4+koPweup8ttVtVxz+P ZN++aHsSiLGLpDIzSXEG6RlpnWupmEWmtwvmveqlWBxU9Nu8Q4p6ztpBiRYdVpBo 53emRbwX3R27E5t1qxxaHj6l/KTrw3HKeoJzbG60kD1pEQzHKvmhkykmMmiu1oZU xbx4LcUAj15v2OUT51JZS/zGjO/Bb2WNz8GPbURAmuujIyTK5SYod9ishBY8DcV7 J7mJnQSaH/R/s5dsEuO8vI3tAwWHYsAcFXeMrNCo+xl3PsmeJe+dnqC9rR52+7nJ PTcoj9Kid9OAwqKHUmZf5Sm9EnHClPWzi4hF+Z5/Kg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgeeigdeilecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufgjfhffkfgfgggtsehttddttddtredtnecuhfhrohhmpefuvggrnhcu hghhihhtthhonhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqne cuggftrfgrthhtvghrnheptdffvdffueeluedvteekvdevhefghedvgeevgffhvedukeeg geelveegjeekteeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgv X-ME-Proxy: Feedback-ID: i23c04076:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 20 Dec 2022 12:04:35 -0500 (EST) Original-Received: by melete.silentflame.com (Postfix, from userid 1000) id 67FA67EFFB9; Tue, 20 Dec 2022 10:04:34 -0700 (MST) In-Reply-To: <392bbde0-9d6e-83c4-0639-af406e279ef1@yandex.ru> (Dmitry Gutov's message of "Tue, 20 Dec 2022 17:13:10 +0200") 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:251536 Archived-At: Hello, On Tue 20 Dec 2022 at 05:13PM +02, Dmitry Gutov wrote: > On 20/12/2022 08:43, Sean Whitton wrote: >> So, I'm now thinking: >> - automatically stash index+worktree for any files with changes staged >> that are*not* modified by the patch to be committed > > I think it's possible to just skip those when checking the index area. And > then, when committing, specify individual files to commit from the index. Ah, so it is! > E.g. this way: > > diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el > index b5959d535c0..dee102d8586 100644 > --- a/lisp/vc/vc-git.el > +++ b/lisp/vc/vc-git.el > @@ -1052,7 +1052,7 @@ vc-git-checkin > (lambda (value) (when (equal value "yes") (list argument))))) > ;; When operating on the whole tree, better pass "-a" than ".", since > "." > ;; fails when we're committing a merge. > - (apply #'vc-git-command nil 0 (if (and only (not vc-git-patch-string)) > files) > + (apply #'vc-git-command nil 0 (if only files) > (nconc (if msg-file (list "commit" "-F" > (file-local-name msg-file)) > (list "commit" "-m")) > > (I'm not sure if the list of files is passed to this function correctly when > committing a patch; if not, fixing that would also be needed.) It's not usually passed, but it could be. So I think I need to clear out files and populate it again during the loop through vc-git-patch-string. We'll want this always to happen, so in the commit command we'll want (and (or only vc-git-patch-string) files). >> - offer to unstage any files with changes staged that*are* modified by >> the patch to be committed. > > Or we could just abort, like we do now. Up to you (do you encounter this > particular situation often?). I feel like I do, yes, though I'm not completely sure which of the two situations I keep finding myself in. It does no harm to have the feature, at least. Thank you for the input. -- Sean Whitton