commit e79563bdabbe90721dc2532c1f97a26478108382 from: omar-polo <47739920+omar-polo@users.noreply.github.com> via: GitHub date: Thu Dec 31 13:41:06 2020 UTC make got program customizable commit - 7c257a7b800d3a5ddf981b66bbbff794fa52f901 commit + e79563bdabbe90721dc2532c1f97a26478108382 blob - 86c3d1677e2e964d97e07e08f04c6f193242fbed blob + 1e4b41965650f5048fa24100852980dbe039988a --- vc-got.el +++ vc-got.el @@ -136,16 +136,23 @@ (require 'vc-got-stage) -(defvar vc-got-cmd "got" - "The got command.") +(defgroup vc-got nil + "VC GoT backend." + :group 'vc) +(defcustom vc-got-program "got" + "Name of the Got executable (excluding any arguments)." + :type 'string + :group 'vc-got) + (defcustom vc-got-diff-switches t "String or list of strings specifying switches for Got diff under VC. If nil, use the value of `vc-diff-switches'. If t, use no switches." :type '(choice (const :tag "Unspecified" nil) (const :tag "None" t) (string :tag "Argument String") - (repeat :tag "Argument List" :value ("") string))) + (repeat :tag "Argument List" :value ("") string)) + :group 'vc-got) ;; helpers @@ -169,8 +176,8 @@ Assume `default-directory' is inside a got worktree." (string-trim (buffer-string) nil "\n")))) (defun vc-got--call (&rest args) - "Call `vc-got-cmd' in the `default-directory' with ARGS and put the output in the current buffer." - (apply #'process-file vc-got-cmd nil (current-buffer) nil args)) + "Call `vc-got-program' in the `default-directory' with ARGS and put the output in the current buffer." + (apply #'process-file vc-got-program nil (current-buffer) nil args)) (defun vc-got--add (files) "Add FILES to got, passing `vc-register-switches' to the command invocation." @@ -486,7 +493,7 @@ ROOT is the worktree root." (defun vc-got-pull (prompt) "Execute got pull, prompting the user for the full command if PROMPT is not nil." - (vc-got--push-pull vc-got-cmd "fetch" prompt (vc-got-root default-directory))) + (vc-got--push-pull vc-got-program "fetch" prompt (vc-got-root default-directory))) (defun vc-got-push (prompt) "Run git push (not got!) in the repository dir.