From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ashwin Kafle Newsgroups: gmane.emacs.bugs Subject: bug#52507: [PATCH] Option for vc-delete-file to keep file on disk Date: Thu, 16 Dec 2021 11:26:44 +0000 Message-ID: <85lf0kdc3v.fsf@ashwink.com.np> References: <20211215095324.18195-1-ashwin@ashwink.com.np> <85pmpxvx8z.fsf@ashwink.com.np> <817fe109-8afe-62fc-e80e-f3d0ef4e4889@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="25203"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 52507@debbugs.gnu.org, Ashwin Kafle To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 16 12:26:38 2021 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 1mxouB-0006Gp-Py for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 16 Dec 2021 12:26:35 +0100 Original-Received: from localhost ([::1]:48668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxouA-0008NT-RI for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 16 Dec 2021 06:26:34 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxotf-0008MN-9B for bug-gnu-emacs@gnu.org; Thu, 16 Dec 2021 06:26:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51533) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxote-0004Xw-OZ for bug-gnu-emacs@gnu.org; Thu, 16 Dec 2021 06:26:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxote-0001dN-JM for bug-gnu-emacs@gnu.org; Thu, 16 Dec 2021 06:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ashwin Kafle Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Dec 2021 11:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52507 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 52507-submit@debbugs.gnu.org id=B52507.16396539556196 (code B ref 52507); Thu, 16 Dec 2021 11:26:02 +0000 Original-Received: (at 52507) by debbugs.gnu.org; 16 Dec 2021 11:25:55 +0000 Original-Received: from localhost ([127.0.0.1]:34846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxotW-0001bs-ON for submit@debbugs.gnu.org; Thu, 16 Dec 2021 06:25:55 -0500 Original-Received: from forward102o.mail.yandex.net ([37.140.190.182]:36638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxotU-0001aK-8r for 52507@debbugs.gnu.org; Thu, 16 Dec 2021 06:25:53 -0500 Original-Received: from iva5-234a6f14a091.qloud-c.yandex.net (iva5-234a6f14a091.qloud-c.yandex.net [IPv6:2a02:6b8:c0c:e87:0:640:234a:6f14]) by forward102o.mail.yandex.net (Yandex) with ESMTP id AA0DA6FF9F94 for <52507@debbugs.gnu.org>; Thu, 16 Dec 2021 14:25:44 +0300 (MSK) Original-Received: from iva5-057a0d1fbbd8.qloud-c.yandex.net (iva5-057a0d1fbbd8.qloud-c.yandex.net [2a02:6b8:c0c:7f1c:0:640:57a:d1f]) by iva5-234a6f14a091.qloud-c.yandex.net (mxback/Yandex) with ESMTP id XUTYIgmjYT-PifGoi0b; Thu, 16 Dec 2021 14:25:44 +0300 Authentication-Results: iva5-234a6f14a091.qloud-c.yandex.net; dkim=pass Original-Received: by iva5-057a0d1fbbd8.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id WMNElgEiKN-PhQeh5kh; Thu, 16 Dec 2021 14:25:43 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) X-Yandex-Fwd: 2 In-Reply-To: <817fe109-8afe-62fc-e80e-f3d0ef4e4889@yandex.ru> (Dmitry Gutov's message of "Thu, 16 Dec 2021 13:03:43 +0300") 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" Xref: news.gmane.io gmane.emacs.bugs:222480 Archived-At: Dmitry Gutov writes: > On 16.12.2021 10:12, Ashwin Kafle wrote: >> But this would mean that every vc-backend will have to be changed, >> immediately. > > Not really: since the arg is optional, we can make sure to only add it > when it's non-nil, and otherwise call the backends with 1 argument. But then the user will get error about wrong number of arguments if the backend doesn't support it. > >> Also, having every vc-backend accept and check keep-on-disk will result >> on a lot of duplicate code that can simply be avoided. > > That's a valid argument, I suppose. Depends on whether many other > backends (VCSes) know how to delete files without deleting them on > disk. > > OTOH, it would be handy to let those that don't declare explicitly > their inability to do that (by not supporting the second argument). I think it would be better to check if the file exists after calling vc backends. If it doesn't and keep-files is non-nil, we can restore from the backup(which is always happening). That will make all vc backends compatible without any change. If other backends support deletion only from the index, then they should do that as it preserves file-modes and such.