void-packages/srcpkgs/emacs/patches/0002-vc-git.el-make-sure-bug-21559-applies-to-git-status.patch
Renato Aguiar 3232604e9d emacs: Backport fixes for Bug#21559 to fix magit issue #2708
Backport fixes for emacs Bug#21559 (25.0.50; auto-revert-mode breaks git rebase)
in order to fix magit issue #2708 (Make magit more robust in the face of
transient index.lock collisions).

References:

- Emacs Bug#21559 <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21559>

- Magit issue #2708 <https://github.com/magit/magit/issues/2708>
2018-12-19 20:50:09 -02:00

40 lines
1.5 KiB
Diff

From 1842a410263aa9d6ddd23efc7603122f9ce6bcb3 Mon Sep 17 00:00:00 2001
From: Andrew Ruder <andy@aeruder.net>
Date: Mon, 24 Sep 2018 21:29:00 -0700
Subject: [PATCH 2/2] vc-git.el: make sure bug#21559 applies to git status
The fix for Bug#21559 is mostly right, but the one command we were
trying to protect, git status --porcelain, doesn't go through
vc-git-command and doesn't actually get the GIT_OPTIONAL_LOCKS=0 treatment.
* lisp/vc/vc-git.el (vc-git--call): Override GIT_OPTIONAL_LOCKS=0
during revert-buffer-in-progress-p
---
lisp/vc/vc-git.el | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git lisp/vc/vc-git.el lisp/vc/vc-git.el
index 0cea5334f4..e779109191 100644
--- lisp/vc/vc-git.el
+++ lisp/vc/vc-git.el
@@ -1598,8 +1598,15 @@ The difference to vc-do-command is that this function always invokes
(or coding-system-for-read vc-git-log-output-coding-system))
(coding-system-for-write
(or coding-system-for-write vc-git-commits-coding-system))
- (process-environment (cons "PAGER=" process-environment)))
- (push "GIT_DIR" process-environment)
+ (process-environment
+ (append
+ `("GIT_DIR"
+ "PAGER="
+ ;; Avoid repository locking during background operations
+ ;; (bug#21559).
+ ,@(when revert-buffer-in-progress-p
+ '("GIT_OPTIONAL_LOCKS=0")))
+ process-environment)))
(apply 'process-file vc-git-program nil buffer nil command args)))
(defun vc-git--out-ok (command &rest args)
--
2.19.0