From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: master 4803fba487 1/2: 'C-x v v' on a diff buffer commits it as a patch (bug#52349) Date: Tue, 30 Aug 2022 14:36:21 -0400 Message-ID: References: <166171593185.16640.41619657947456727@vcs2.savannah.gnu.org> <20220828194533.23A6BC00889@vcs2.savannah.gnu.org> <87r10znm0y.fsf@gnus.org> <83fshfvvyn.fsf@gnu.org> <999d1cb2-6b7f-8020-5202-e919278d895e@yandex.ru> <505371c4-43ac-e988-e5c2-f532b987c237@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="21990"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: "Alfred M. Szmidt" , eliz@gnu.org, larsi@gnus.org, juri@jurta.org, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 30 20:38:49 2022 Return-path: Envelope-to: ged-emacs-devel@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 1oT68O-0005UF-0i for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Aug 2022 20:38:48 +0200 Original-Received: from localhost ([::1]:37718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oT68M-0006OL-Ka for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Aug 2022 14:38:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35446) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT66A-0005Rp-Hy for emacs-devel@gnu.org; Tue, 30 Aug 2022 14:36:36 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:51435) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT666-0004Ad-HE; Tue, 30 Aug 2022 14:36:29 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id EB6D8442708; Tue, 30 Aug 2022 14:36:23 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 82DC94426EE; Tue, 30 Aug 2022 14:36:22 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1661884582; bh=qQGGh0nPDw350CKOwoHCX6TohSOrMSKuiSZGSZV2bpc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=B44tSuJxDZhx/4LbRwZqTkoOPlqvYfPz8UozcM+ca9hZdxAx53mbl8TQjuOC0mgA+ Y7RbLyOnITbrYXT93Q0h4YUiYsdeU3MuNltVZRVv89uuhAkRk2mRPRK5dFmOQPNPEj kkuaetw2I3jayq04fCvWjRG1h7dExrKuIUGjlrxQceIn+8S5M2mfsyWT0tu1NGtUF0 s5HK7DZDKQJb8jBJkbMVI2dqZPe4t3PzKgInkdt+1mVCacWLKcIh4OYexy2rObKYAI SzPIueSpRCEvg4DytDT1mybflM2jP5v6wyWIZlyKJOa1lvaImsIVcoqErC374F9Ngn OeP2eXNfObSJg== Original-Received: from alfajor (unknown [45.44.229.252]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 54AD312061D; Tue, 30 Aug 2022 14:36:22 -0400 (EDT) In-Reply-To: <505371c4-43ac-e988-e5c2-f532b987c237@yandex.ru> (Dmitry Gutov's message of "Tue, 30 Aug 2022 18:26:41 +0300") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, GAPPY_SUBJECT=0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:294380 Archived-At: Dmitry Gutov [2022-08-30 18:26:41] wrote: > On 30.08.2022 18:16, Stefan Monnier wrote: >>> I can look into adapting this approach for other VCS if nobody beats me to >>> it. As long as we fundamentally agree on the behavior. >> Fine by me. I'll just mention that I think we should be careful to make >> sure no info is lost if Emacs crashes in the middle of the operation. > File contents' backups should remain somewhere in /tmp, *shrug*. > It might take some effort to find them, though. We could do something like: run-the-vcs-diff-on-the FILES >VC-pending-changes patch -R I think it's hard to implement this with even more safety somehow. I'm just worried that the uncommmitted changes we need to temporarily remove are the rare parts that contain information that's not yet duplicated in the VCS's data, so if we only store it in an Emacs buffer it's vulnerable to an Emacs crash (which is something that *does* happen, especially for us poor souls who run with experimental code and with all assertions enabled :-). > Git makes it uniquely easier to do. Indeed. Stefan