all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Ashwin Kafle <ashwin@ashwink.com.np>
Cc: 52507@debbugs.gnu.org
Subject: bug#52507: [PATCH] Option for vc-delete-file to keep file on disk
Date: Wed, 15 Dec 2021 20:06:56 +0200	[thread overview]
Message-ID: <861r2dzqrj.fsf@mail.linkov.net> (raw)
In-Reply-To: <85o85hsr3b.fsf@ashwink.com.np> (Ashwin Kafle's message of "Wed,  15 Dec 2021 17:41:44 +0000")

>>> +	(let ((backup-inhibited nil)
>>> + ;; if you don't set this, then for some reason, the file is never brought back
>>> +              (backup-by-copying t))
>>
>> I remember having the same problem while improving `vc-rename-file'.
>> To solve the problem, it required adding `vc-file-clearprops'.
>> Maybe it could here as well?
>
> There was a call to vc-file-clearprops later. I moved that earlier
> before backup and that didn't seem to work.

Then another question: why backup is needed at all?
When the file is not going to be deleted, then
there is no need to make a backup copy?

>>> -    (vc-resynch-buffer file nil t)))
>>> +    (vc-resynch-buffer file keep-file t)))
>>
>> It seems vc-resynch-window already uses `vc-file-clearprops'
>> when `keep-file' is specified, but also on some more conditions.
>
> I'm sorry, but I didn't really understand the above. I don't really know
> elisp to be honest.

The comment before calling `vc-resynch-buffer' says it's to
make sure the buffer is deleted.  But it seems the buffer
is already deleted at that point?

Also it looks that your another change is dangerous:

 (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.

Generally, you have a good idea, but it needs more careful handling
with the existing vc commands.





  reply	other threads:[~2021-12-15 18:06 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15  9:53 bug#52507: [PATCH] Option for vc-delete-file to keep file on disk Ashwin Kafle
2021-12-15 16:53 ` Juri Linkov
2021-12-15 17:41   ` Ashwin Kafle
2021-12-15 18:06     ` Juri Linkov [this message]
2021-12-15 18:26       ` Ashwin Kafle
2021-12-15 18:34         ` Ashwin Kafle
2021-12-16 17:01           ` Juri Linkov
2021-12-19 23:46             ` Dmitry Gutov
2021-12-23 17:20               ` Juri Linkov
2021-12-24  0:48                 ` Dmitry Gutov
2021-12-26 17:43                   ` Juri Linkov
2021-12-26 19:12                     ` Dmitry Gutov
2021-12-26 14:31               ` Ashwin Kafle
2021-12-26 14:23             ` Ashwin Kafle
2021-12-26 15:38               ` Dmitry Gutov
2021-12-26 15:51                 ` Ashwin Kafle
2021-12-26 15:57                   ` Dmitry Gutov
2021-12-26 16:12                     ` Ashwin Kafle
2021-12-26 16:28                       ` Dmitry Gutov
2021-12-26 17:03                         ` Ashwin Kafle
2021-12-27  0:03                           ` Dmitry Gutov
2021-12-27  4:08                             ` Ashwin Kafle
2021-12-28  0:53                               ` Dmitry Gutov
2022-09-08 14:17                                 ` bug#52508: " Lars Ingebrigtsen
2021-12-26 17:41               ` bug#52507: " Juri Linkov
2021-12-27 17:58               ` Juri Linkov
2021-12-15 22:59 ` Dmitry Gutov
2021-12-16  7:12   ` Ashwin Kafle
2021-12-16 10:03     ` Dmitry Gutov
2021-12-16 11:26       ` Ashwin Kafle
2021-12-16 11:27         ` Dmitry Gutov
2021-12-16 14:07           ` bug#52507: [PATCH v3] " Ashwin Kafle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=861r2dzqrj.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=52507@debbugs.gnu.org \
    --cc=ashwin@ashwink.com.np \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.