[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 1c1ff3bfd1 1/3: Accept "-w" as safe value for vc-git-annotate-swi
From: |
Stefan Kangas |
Subject: |
master 1c1ff3bfd1 1/3: Accept "-w" as safe value for vc-git-annotate-switches |
Date: |
Fri, 9 Sep 2022 19:13:09 -0400 (EDT) |
branch: master
commit 1c1ff3bfd12161d14f791658e22481acf9549109
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>
Accept "-w" as safe value for vc-git-annotate-switches
* lisp/vc/vc-git.el
(vc-git-annotate-switches-safe-p): New predicate function.
(vc-git-annotate-switches): Use above new predicate function to
check if it's :safe.
---
lisp/vc/vc-git.el | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 9dfdd9e7b1..2941cc75be 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -119,6 +119,14 @@ If nil, use the value of `vc-diff-switches'. If t, use no
switches."
(repeat :tag "Argument List" :value ("") string))
:version "23.1")
+;;;###autoload
+(defun vc-git-annotate-switches-safe-p (switches)
+ "Check if local value of `vc-git-annotate-switches' is safe.
+Currently only \"-w\" (ignore whitespace) is considered safe, but
+this list might be extended in the future."
+ ;; TODO: Probably most options are perfectly safe.
+ (equal switches "-w"))
+
(defcustom vc-git-annotate-switches nil
"String or list of strings specifying switches for Git blame under VC.
If nil, use the value of `vc-annotate-switches'. If t, use no switches."
@@ -127,6 +135,7 @@ If nil, use the value of `vc-annotate-switches'. If t, use
no switches."
(string :tag "Argument String")
(repeat :tag "Argument List" :value ("") string))
:version "25.1")
+;;;###autoload(put 'vc-git-annotate-switches 'safe-local-variable
#'vc-git-annotate-switches-safe-p)
(defcustom vc-git-log-switches nil
"String or list of strings specifying switches for Git log under VC."