unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Aleksandr Vityazev via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Dmitry Gutov <dmitry@gutov.dev>
Cc: 68443@debbugs.gnu.org
Subject: bug#68443: 30.0.50; Cannot commit from *vc-diff* if there is a deleted file.
Date: Wed, 17 Jan 2024 13:56:08 +0300	[thread overview]
Message-ID: <877ck82ppz.fsf@disroot.org> (raw)
In-Reply-To: <9dfe6be4-afa8-430e-a45e-e651c479cb81@gutov.dev> (Dmitry Gutov's message of "Wed, 17 Jan 2024 06:25:34 +0200")

On 2024-01-17 06:25, Dmitry Gutov wrote:

> Hi! Thanks for the report.
>
> On 13/01/2024 15:56, Aleksandr Vityazev via Bug reports for GNU Emacs,
> the Swiss army knife of text editors wrote:
>> Hi,
>> Steps to reproduce with emacs -q:
>> 1. Enter git repository;
>> 2. vc-delete-file some file;
>> 3. vc-root-diff;
>> 4. From *vc-diff* buffer vc-next-action;
>> 5. In *vc-log* write summary and invoke vc-next-action;
>> 6. get error (wrong-type-argument stringp nil)
>> Full backtrace:
>> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>>    file-directory-p(nil)
>>    #f(compiled-function (files comment) #<bytecode
>> 0x1e31e0a127714b22>)((#(".gitignore" 0 10 (fontified t face
>> (diff-file-header diff-header))) #("buffer.c" 0 8 (fontified t face
>> (diff-file-header diff-header))) nil) #("Summary: Delete file.\n" 0
>> 8 (jit-lock-defer-multiline t face log-edit-header fontified t field
>> header) 8 9 (jit-lock-defer-multiline t fontified t field header) 9
>> 21 (jit-lock-defer-multiline t face log-edit-summary fontified t
>> field header) 21 22 (fontified t)))
>>    vc-finish-logentry()
>>    funcall-interactively(vc-finish-logentry)
>>    log-edit-done()
>>    funcall-interactively(log-edit-done)
>>    command-execute(log-edit-done)
>
> Try the patch below, seems to work here:
>
> diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
> index 03efe0fdb31..83d580d98dd 100644
> --- a/lisp/vc/diff-mode.el
> +++ b/lisp/vc/diff-mode.el
> @@ -3014,7 +3014,7 @@ diff-vc-deduce-fileset
>        (goto-char (point-min))
>        (while (progn (diff-file-next) (not (eobp)))
>          (push (diff-find-file-name nil t) files)))
> -    (list backend (nreverse files) nil nil 'patch)))
> +    (list backend (delete nil (nreverse files)) nil nil 'patch)))

Yes with this patch the error is no longer present, but the deleted file
is not displayed in the *log-edit-files* buffer, unlike if you run
vc-next-action from *vc-dir*. Although this is another bug report.

>  (defun diff--filter-substring (str)
>    (when diff-font-lock-prettify
>
>
> (Eli, would this be suitable for emacs-29?)
>

-- 
Best regards,
Aleksandr Vityazev





  reply	other threads:[~2024-01-17 10:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-13 13:56 bug#68443: 30.0.50; Cannot commit from *vc-diff* if there is a deleted file Aleksandr Vityazev via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-17  4:25 ` Dmitry Gutov
2024-01-17 10:56   ` Aleksandr Vityazev via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-01-17 11:36     ` Dmitry Gutov
2024-01-17 16:32       ` Juri Linkov
2024-01-18  7:50         ` Juri Linkov
2024-01-18 16:47           ` Dmitry Gutov
2024-01-17 11:34   ` Eli Zaretskii
2024-01-17 23:26     ` Dmitry Gutov

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=877ck82ppz.fsf@disroot.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=68443@debbugs.gnu.org \
    --cc=avityazev@disroot.org \
    --cc=dmitry@gutov.dev \
    /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).