From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#52507: [PATCH] Option for vc-delete-file to keep file on disk Date: Thu, 16 Dec 2021 19:01:20 +0200 Organization: LINKOV.NET Message-ID: <86k0g4a875.fsf@mail.linkov.net> References: <20211215095324.18195-1-ashwin@ashwink.com.np> <86a6h13j4i.fsf@mail.linkov.net> <85o85hsr3b.fsf@ashwink.com.np> <861r2dzqrj.fsf@mail.linkov.net> <85fsqt67y1.fsf@ashwink.com.np> <8535mt67k8.fsf@ashwink.com.np> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6641"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 52507@debbugs.gnu.org To: Ashwin Kafle Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 16 18:36:52 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 1mxugW-0001aS-Eq for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 16 Dec 2021 18:36:52 +0100 Original-Received: from localhost ([::1]:35194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxugV-0000RF-Fa for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 16 Dec 2021 12:36:51 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:48554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxufk-0007Ov-7Z for bug-gnu-emacs@gnu.org; Thu, 16 Dec 2021 12:36:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53278) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxufj-00027T-Ve for bug-gnu-emacs@gnu.org; Thu, 16 Dec 2021 12:36:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxufj-00061l-T3 for bug-gnu-emacs@gnu.org; Thu, 16 Dec 2021 12:36:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Dec 2021 17:36:03 +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.163967611423002 (code B ref 52507); Thu, 16 Dec 2021 17:36:03 +0000 Original-Received: (at 52507) by debbugs.gnu.org; 16 Dec 2021 17:35:14 +0000 Original-Received: from localhost ([127.0.0.1]:36569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxuew-0005yw-0N for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:35:14 -0500 Original-Received: from relay10.mail.gandi.net ([217.70.178.230]:35987) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxuet-0005yY-TY for 52507@debbugs.gnu.org; Thu, 16 Dec 2021 12:35:12 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 8F67624000C; Thu, 16 Dec 2021 17:35:03 +0000 (UTC) In-Reply-To: <8535mt67k8.fsf@ashwink.com.np> (Ashwin Kafle's message of "Wed, 15 Dec 2021 18:34:31 +0000") 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:222508 Archived-At: >>> (defun vc-git-delete-file (file) >>> - (vc-git-command nil 0 (vc-git--literal-pathspec file) "rm" "-f" "--")) >>> + (vc-git-command nil 0 (vc-git--literal-pathspec file) "rm" "-f" "--cached" "--"))) >>> >>> because it deletes the file in the staging area >>> that is not used by vc-git, so there is no way >>> to commit the deletion using vc commands. >> ... > Oh, you mean just that single commit can't be done by vc now. Yeah, > that seems true. Can you think of any solution for that here? --cached can't be used anyway, because vc commands doesn't use the git index. Currently, after vc-delete-file, we have the following status in vc-dir: ./ removed file1 unregistered file1~ So the user can commit the removed file with vc-next-action. Then after this, the user can manually rename the unregistered backup by removing ~ from the file name. So it seems that you want to automate the last part, i.e. to try automatically rename the file from its backup copy after all changes were committed?