From: Eli Zaretskii Date: Sat, 2 Sep 2023 08:33:44 +0000 (-0400) Subject: Merge from origin/emacs-29 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7395123479704ab94601cb2836388af008090185;p=emacs.git Merge from origin/emacs-29 dbbcf4a6599 Fix fontification of " in edit-kbd-macro 2137fdfd550 * lisp/emacs-lisp/gv.el (buffer-local-value): Unobsolete ... e660ee88e3d ; Remove incorrect example from ELisp Reference manual c32fd92d67e Add documentation to plstore.el 57760f585e2 * lisp/help.el (substitute-quotes): Improve docstring. 60dcea7658a Fix two defcustom :types 890a4c209ab Fix `image-auto-resize-on-window-resize' custom :type 369f2eea100 Add "terraform-ls" LSP server to Eglot 5cbe96d17f6 ; Improve documentation of 'char-table-range' a219ee8c314 Fix minor bugs in vc-git and vc-hg on Windows uncovered b... 3f7598806eb Add syntax-propertize-function to js-ts-mode 18b292140ee ; * src/treesit.c: Add ts function boilerplate ec4d29c4494 Improve performance of treesit_cursor_helper_1 # Conflicts: # lisp/vc/vc-git.el # src/treesit.c --- 7395123479704ab94601cb2836388af008090185 diff --cc lisp/vc/vc-git.el index 9a78264d8ff,fe6215f47b8..4c409465860 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@@ -1058,27 -1014,15 +1058,28 @@@ It is based on `log-edit-mode', and ha ;; might not support the non-ASCII characters in the log ;; message. Handle also remote files. (if (eq system-type 'windows-nt) - (let ((default-directory (file-name-directory file1))) + (let ((default-directory (or (file-name-directory file1) + default-directory))) - (make-nearby-temp-file "git-msg"))))) + (make-nearby-temp-file "git-msg")))) + to-stash) (when vc-git-patch-string (unless (zerop (vc-git-command nil t nil "diff" "--cached" "--quiet")) - ;; Check that all staged changes also exist in the patch. - ;; This is needed to allow adding/removing files that are - ;; currently staged to the index. So remove the whole file diff - ;; from the patch because commit will take it from the index. + ;; Check that what's already staged is compatible with what + ;; we want to commit (bug#60126). + ;; + ;; 1. If the changes to a file in the index are identical to + ;; the changes to that file we want to commit, remove the + ;; changes from our patch, and let the commit take them + ;; from the index. This is necessary for adding and + ;; removing files to work. + ;; + ;; 2. If the changes to a file in the index are different to + ;; changes to that file we want to commit, then we have to + ;; unstage the changes or abort. + ;; + ;; 3. If there are changes to a file in the index but we don't + ;; want to commit any changes to that file, we need to + ;; stash those changes before committing. (with-temp-buffer ;; If the user has switches like -D, -M etc. in their ;; `vc-git-diff-switches', we must pass them here too, or