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: Sun, 26 Dec 2021 19:43:20 +0200 Organization: LINKOV.NET Message-ID: <86k0frz66d.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> <86k0g4a875.fsf@mail.linkov.net> <86ilvfba32.fsf@mail.linkov.net> <49062cc5-64e2-3214-4e8f-bc496b04e15e@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="25964"; 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, Ashwin Kafle To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 26 18:47:13 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 1n1Xc1-0006Yi-2u for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Dec 2021 18:47:13 +0100 Original-Received: from localhost ([::1]:44470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1Xbz-0006ht-Kt for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Dec 2021 12:47:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44272) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1Xbr-0006fO-4E for bug-gnu-emacs@gnu.org; Sun, 26 Dec 2021 12:47:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58167) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n1Xbq-0006rC-QL for bug-gnu-emacs@gnu.org; Sun, 26 Dec 2021 12:47:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n1Xbq-0004up-Ic for bug-gnu-emacs@gnu.org; Sun, 26 Dec 2021 12:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Dec 2021 17:47: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.164054077218785 (code B ref 52507); Sun, 26 Dec 2021 17:47:02 +0000 Original-Received: (at 52507) by debbugs.gnu.org; 26 Dec 2021 17:46:12 +0000 Original-Received: from localhost ([127.0.0.1]:41473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1Xb1-0004su-Ns for submit@debbugs.gnu.org; Sun, 26 Dec 2021 12:46:11 -0500 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:41777) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1Xau-0004rS-R9 for 52507@debbugs.gnu.org; Sun, 26 Dec 2021 12:46:09 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 6F58E240006; Sun, 26 Dec 2021 17:45:56 +0000 (UTC) In-Reply-To: <49062cc5-64e2-3214-4e8f-bc496b04e15e@yandex.ru> (Dmitry Gutov's message of "Fri, 24 Dec 2021 02:48:01 +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" Xref: news.gmane.io gmane.emacs.bugs:223159 Archived-At: >> I doubt that anyone might want to commit the file deletion immediately, >> because file deletions usually are committed together with other changes. > > Right. That's why I suggested either to have a buffer-local var to store > the "to be deleted" status, or do that in the staging area first. > >> But maybe git has a way to mark a file as deleted without actually deleting it? >> So `git status --porcelain -z --untracked-files` could return "D" for such file >> that still exists, this would be the simplest solution. > > 'git rm --cached', used in the patch for this issue originally, is indeed > such command. Unless I misunderstood the question. > > $ git rm --cached CONTRIBUTE > rm 'CONTRIBUTE' $ git status --porcelain > --untracked-files > D CONTRIBUTE > ?? CONTRIBUTE Both "D " and "??" correspond to the 'unregistered' status in vc-dir according to 'vc-git--git-status-to-vc-state': (defun vc-git--git-status-to-vc-state (code-list) ... ('("D " "??") 'unregistered)