emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 4803fba487 1/2: 'C-x v v' on a diff buffer commits it as a pa


From: Juri Linkov
Subject: Re: master 4803fba487 1/2: 'C-x v v' on a diff buffer commits it as a patch (bug#52349)
Date: Wed, 31 Aug 2022 09:53:01 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

>>> I can look into adapting this approach for other VCS if nobody beats
>>> me to it. As long as we fundamentally agree on the behavior.
>> Thank you.
>
> This seems to work.
>
> Might use some extra polish, though, if people also encounter the one weird
> error about "buffer already killed" that I saw a few times but then stopped
> after a restart.

Thanks, looks universal enough to handle all backends.
I've tried it out, but it gets stuck asking the same question:

  Hunk has already been applied; undo it? (y or n)

because of the infinite loop in:

            (while (not (eobp))
              (diff-apply-hunk))

After removing the loop, everything works fine.

> +(defun vc-default-checkin-patch (backend patch-string comment)
> +  (with-current-buffer (get-buffer-create " *vc-checkin-patch*")
> +    (erase-buffer)
> +    (insert patch-string)
> +    (diff-mode)
> +    (pcase-let ((`(,backend ,files) (diff-vc-deduce-fileset))
> +                (root (vc-call-backend backend 'root default-directory))
> +                (tmpdir (make-temp-file "vc-checkin-patch" t)))

I'm worried that after a crash, reboot might wipe out the /tmp dir.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]