From: Juri Linkov <juri@linkov.net>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 52507@debbugs.gnu.org, Ashwin Kafle <ashwin@ashwink.com.np>
Subject: bug#52507: [PATCH] Option for vc-delete-file to keep file on disk
Date: Thu, 23 Dec 2021 19:20:45 +0200 [thread overview]
Message-ID: <86ilvfba32.fsf@mail.linkov.net> (raw)
In-Reply-To: <f6dc58c6-3139-0dd4-f695-a6162fffe906@yandex.ru> (Dmitry Gutov's message of "Mon, 20 Dec 2021 02:46:29 +0300")
> Or alternatively, if we consider the potential feature which we've been
> talking about (committing a subset of hunks from a file selectively), its
> implementation should have a step which either uses a staging area, or adds
> stuff to it first.
>
> And that step could be the place to enact a change like presently discussed
> (add a deletion to the staging area, and then commit it). That deletion
> would either already be in the staging area (meaning we pick up any staged
> changes for commit, which might be weird), or we would store the "intent to
> remove with --cached" in some buffer-local variable, which would be picked
> up by the new code.
>
> The latter solution would be the "cleaner" one, but the former is one that
> we could have _right now_.
>
> On the plus side, the former also doesn't seem like it's going to require
> changes in the VC API after all.
The feature of committing a subset of hunks will be performed by one command
'log-edit-done' ('C-c C-c') from the *vc-log* buffer that will run git commands
`git apply --cached` followed by `git commit`.
Doing something similar could mean for example that 'C-u M-x vc-delete-file'
could immediately pop up the *vc-log* buffer waiting for a commit message,
and on 'C-c C-c' will commit only the deleted file.
I doubt that anyone might want to commit the file deletion immediately,
because file deletions usually are committed together with other changes.
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.
next prev parent reply other threads:[~2021-12-23 17:20 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
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 [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86ilvfba32.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=52507@debbugs.gnu.org \
--cc=ashwin@ashwink.com.np \
--cc=dgutov@yandex.ru \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).