Blame


1 00713762 2021-08-17 op ;;; vc-got.el --- VC backend for Game of Trees VCS -*- lexical-binding: t; -*-
2 af5ef7cd 2020-11-29 op
3 f0d7c7e7 2022-05-28 op ;; Copyright (C) 2021-2022 Free Software Foundation, Inc.
4 af5ef7cd 2020-11-29 op
5 76d978fa 2021-01-05 op ;; Author: Omar Polo <op@omarpolo.com>
6 4b3c0c67 2021-08-17 op ;; Timo Myyrä <timo.myyra@bittivirhe.fi>
7 78607b0c 2022-05-28 op ;; URL: https://projects.omarpolo.com/vc-got.html
8 61b9a83b 2021-08-17 op ;; Keywords: vc tools
9 bc158324 2022-08-05 op ;; Version: 1.2
10 3efc7598 2021-09-09 op ;; Package-Requires: ((emacs "25.1"))
11 af5ef7cd 2020-11-29 op
12 406d7b4d 2020-12-26 op ;; This program is free software; you can redistribute it and/or modify
13 406d7b4d 2020-12-26 op ;; it under the terms of the GNU General Public License as published by
14 406d7b4d 2020-12-26 op ;; the Free Software Foundation, either version 3 of the License, or
15 406d7b4d 2020-12-26 op ;; (at your option) any later version.
16 af5ef7cd 2020-11-29 op
17 406d7b4d 2020-12-26 op ;; This program is distributed in the hope that it will be useful,
18 406d7b4d 2020-12-26 op ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 406d7b4d 2020-12-26 op ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 406d7b4d 2020-12-26 op ;; GNU General Public License for more details.
21 af5ef7cd 2020-11-29 op
22 406d7b4d 2020-12-26 op ;; You should have received a copy of the GNU General Public License
23 406d7b4d 2020-12-26 op ;; along with this program. If not, see <https://www.gnu.org/licenses/>.
24 406d7b4d 2020-12-26 op
25 7726b6c9 2021-08-10 op ;;; Commentary:
26 af5ef7cd 2020-11-29 op
27 b3b5f78a 2022-05-28 op ;; vc-got is a VC backend for the Game of Trees (got) version control
28 b3b5f78a 2022-05-28 op ;; system.
29 b3b5f78a 2022-05-28 op ;;
30 af5ef7cd 2020-11-29 op ;; Backend implementation status
31 af5ef7cd 2020-11-29 op ;;
32 af5ef7cd 2020-11-29 op ;; Function marked with `*' are required, those with `-' are optional.
33 af5ef7cd 2020-11-29 op ;;
34 af5ef7cd 2020-11-29 op ;; FUNCTION NAME STATUS
35 af5ef7cd 2020-11-29 op ;;
36 af5ef7cd 2020-11-29 op ;; BACKEND PROPERTIES:
37 af5ef7cd 2020-11-29 op ;; * revision-granularity DONE
38 af5ef7cd 2020-11-29 op ;; - update-on-retrieve-tag XXX: what should this do?
39 af5ef7cd 2020-11-29 op ;;
40 af5ef7cd 2020-11-29 op ;; STATE-QUERYING FUNCTIONS:
41 af5ef7cd 2020-11-29 op ;; * registered DONE
42 af5ef7cd 2020-11-29 op ;; * state DONE
43 af5ef7cd 2020-11-29 op ;; - dir-status-files DONE
44 a8466f02 2020-12-07 op ;; - dir-extra-headers DONE
45 2d83de2e 2021-01-05 op ;; - dir-printer DONE
46 af5ef7cd 2020-11-29 op ;; - status-fileinfo-extra NOT IMPLEMENTED
47 af5ef7cd 2020-11-29 op ;; * working-revision DONE
48 af5ef7cd 2020-11-29 op ;; * checkout-model DONE
49 694534b4 2020-12-05 op ;; - mode-line-string DONE
50 23a0b465 2020-11-30 op ;;
51 23a0b465 2020-11-30 op ;; STATE-CHANGING FUNCTIONS:
52 23a0b465 2020-11-30 op ;; * create-repo NOT IMPLEMENTED
53 eb85ad27 2020-12-05 op ;; I don't think got init does what this function is supposed to
54 eb85ad27 2020-12-05 op ;; do.
55 23a0b465 2020-11-30 op ;; * register DONE
56 23a0b465 2020-11-30 op ;; - responsible-p DONE
57 3ec8a8b4 2021-08-17 op ;; - receive-file NOT NEEDED, default `register' is fine
58 241a3b12 2021-08-11 op ;; - unregister DONE
59 23a0b465 2020-11-30 op ;; * checkin DONE
60 23a0b465 2020-11-30 op ;; * find-revision DONE
61 eb85ad27 2020-12-05 op ;; * checkout NOT IMPLEMENTED
62 eb85ad27 2020-12-05 op ;; I'm not sure how to properly implement this. Does filling
63 eb85ad27 2020-12-05 op ;; FILE with the find-revision do the trick? Or use got update?
64 eb85ad27 2020-12-05 op ;; * revert DONE
65 eb85ad27 2020-12-05 op ;; - merge-file NOT IMPLEMENTED
66 eb85ad27 2020-12-05 op ;; - merge-branch DONE
67 eb85ad27 2020-12-05 op ;; - merge-news NOT IMPLEMENTED
68 eb85ad27 2020-12-05 op ;; - pull DONE
69 686eac9a 2020-12-07 op ;; - push DONE
70 3cdb0759 2020-01-03 47739920+ ;; - steal-lock NOT NEEDED, `got' is not using locks
71 eb85ad27 2020-12-05 op ;; - modify-change-comment NOT IMPLEMENTED
72 eb85ad27 2020-12-05 op ;; can be implemented via histedit, if I understood correctly
73 eb85ad27 2020-12-05 op ;; what it is supposed to do.
74 ae2ad572 2021-08-17 op ;; - mark-resolved NOT NEEDED
75 ae2ad572 2021-08-17 op ;; got notice by itself when a file doesn't have any pending
76 ae2ad572 2021-08-17 op ;; conflicts to be resolved.
77 ae2ad572 2021-08-17 op ;; - find-admin-dir NOT NEEDED
78 eb85ad27 2020-12-05 op ;;
79 eb85ad27 2020-12-05 op ;; HISTORY FUNCTIONS
80 eb85ad27 2020-12-05 op ;; * print-log DONE
81 9ad1eb5d 2020-12-07 op ;; * log-outgoing DONE
82 6eda2f1f 2020-12-26 op ;; * log-incoming DONE
83 eb85ad27 2020-12-05 op ;; - log-search DONE
84 0a3316a6 2021-02-22 op ;; - log-view-mode DONE
85 6eda2f1f 2020-12-26 op ;; - show-log-entry NOT IMPLEMENTED
86 6eda2f1f 2020-12-26 op ;; - comment-history NOT IMPLEMENTED
87 6eda2f1f 2020-12-26 op ;; - update-changelog NOT IMPLEMENTED
88 7c257a7b 2020-12-31 noreply ;; * diff DONE
89 5fb2f474 2021-08-10 op ;; - revision-completion-table DONE
90 3f25d9ff 2020-01-02 noreply ;; - annotate-command DONE
91 3f25d9ff 2020-01-02 noreply ;; - annotate-time DONE
92 424f5152 2021-08-10 op ;; - annotate-current-time NOT NEEDED
93 424f5152 2021-08-10 op ;; the default time handling is enough.
94 3f25d9ff 2020-01-02 noreply ;; - annotate-extract-revision-at-line DONE
95 7c257a7b 2020-12-31 noreply ;; - region-history NOT IMPLEMENTED
96 7c257a7b 2020-12-31 noreply ;; - region-history-mode NOT IMPLEMENTED
97 7c257a7b 2020-12-31 noreply ;; - mergebase NOT IMPLEMENTED
98 7c257a7b 2020-12-31 noreply ;;
99 7c257a7b 2020-12-31 noreply ;; TAG SYSTEM
100 6ab1c7b4 2021-08-11 op ;; - create-tag DONE
101 09d59379 2021-08-11 op ;; - retrieve-tag DONE
102 7c257a7b 2020-12-31 noreply ;;
103 7c257a7b 2020-12-31 noreply ;; MISCELLANEOUS NOT IMPLEMENTED
104 3cdb0759 2020-01-03 47739920+ ;; - make-version-backups-p NOT NEEDED, `got' works fine locally
105 7c257a7b 2020-12-31 noreply ;; - root DONE
106 49945a03 2021-08-11 op ;; - ignore NOT NEEDED, the default action is good
107 49945a03 2021-08-11 op ;; - ignore-completion-table NOT NEEDED, the default action is good
108 2552a6c7 2021-08-11 op ;; - find-ignore-file DONE
109 3f25d9ff 2020-01-02 noreply ;; - previous-revision DONE
110 3f25d9ff 2020-01-02 noreply ;; - next-revision DONE
111 7c257a7b 2020-12-31 noreply ;; - log-edit-mode NOT IMPLEMENTED
112 3cdb0759 2020-01-03 47739920+ ;; - check-headers NOT NEEDED, `got' does not use headers
113 a96df0e8 2020-01-03 noreply ;; - delete-file DONE
114 3ec8a8b4 2021-08-17 op ;; - rename-file NOT IMPLEMENTED
115 c151c257 2021-08-03 op ;; - find-file-hook DONE
116 3ec8a8b4 2021-08-17 op ;; - extra-menu NOT IMPLEMENTED
117 3cdb0759 2020-01-03 47739920+ ;; - extra-dir-menu NOT IMPLEMENTED, same as above
118 7bb16f79 2020-01-03 op ;; - conflicted-files DONE
119 8b635a9f 2020-01-03 op ;; - repository-url DONE
120 b3b5f78a 2022-05-28 op
121 b3b5f78a 2022-05-28 op ;;; Code:
122 af5ef7cd 2020-11-29 op
123 eb85ad27 2020-12-05 op ;; TODO: vc-git has most function that starts with:
124 eb85ad27 2020-12-05 op ;;
125 eb85ad27 2020-12-05 op ;; (let* ((root (vc-git-root default-directory))
126 eb85ad27 2020-12-05 op ;; (buffer (format "*vc-git : %s*" (expand-file-name root)))
127 eb85ad27 2020-12-05 op ;; ...)
128 eb85ad27 2020-12-05 op ;; ...)
129 eb85ad27 2020-12-05 op ;;
130 eb85ad27 2020-12-05 op ;; we should 1) investigate if also other backends do something like
131 eb85ad27 2020-12-05 op ;; this (or if there is a better way) and 2) try to do the same.
132 af5ef7cd 2020-11-29 op
133 af5ef7cd 2020-11-29 op (eval-when-compile
134 af5ef7cd 2020-11-29 op (require 'subr-x))
135 af5ef7cd 2020-11-29 op
136 af5ef7cd 2020-11-29 op (require 'cl-lib)
137 af5ef7cd 2020-11-29 op (require 'seq)
138 23a0b465 2020-11-30 op (require 'vc)
139 3f25d9ff 2020-01-02 noreply (require 'vc-annotate)
140 f7012697 2021-08-17 op
141 f7012697 2021-08-17 op ;; FIXME: avoid loading this? We only need it for
142 f7012697 2021-08-17 op ;; log-edit-extract-headers in vc-got-checkin.
143 f7012697 2021-08-17 op (require 'log-edit)
144 6b6c8a78 2021-01-04 op
145 2d83de2e 2021-01-05 op ;; FIXME: avoid loading this? We only need it for
146 2d83de2e 2021-01-05 op ;; vc-dir-filename-mouse-map in our custom printer.
147 2d83de2e 2021-01-05 op (require 'vc-dir)
148 ba123905 2020-12-08 op
149 95a78ecb 2021-08-31 op ;; FIXME: avoid loading this? We only need it for
150 95a78ecb 2021-08-31 op ;; compilation-{directory,arguments}.
151 95a78ecb 2021-08-31 op (require 'compile)
152 95a78ecb 2021-08-31 op
153 95a78ecb 2021-08-31 op ;; FIXME: avoid loading this? We only need it for
154 95a78ecb 2021-08-31 op ;; log-view-{file-re,per-file-logs,message-re}.
155 95a78ecb 2021-08-31 op (require 'log-view)
156 95a78ecb 2021-08-31 op
157 e79563bd 2020-12-31 noreply (defgroup vc-got nil
158 e79563bd 2020-12-31 noreply "VC GoT backend."
159 e79563bd 2020-12-31 noreply :group 'vc)
160 af5ef7cd 2020-11-29 op
161 e79563bd 2020-12-31 noreply (defcustom vc-got-program "got"
162 e79563bd 2020-12-31 noreply "Name of the Got executable (excluding any arguments)."
163 6eea6cfb 2021-01-05 op :type 'string)
164 e79563bd 2020-12-31 noreply
165 12ca62f2 2020-12-26 op (defcustom vc-got-diff-switches t
166 12ca62f2 2020-12-26 op "String or list of strings specifying switches for Got diff under VC.
167 12ca62f2 2020-12-26 op If nil, use the value of `vc-diff-switches'. If t, use no switches."
168 12ca62f2 2020-12-26 op :type '(choice (const :tag "Unspecified" nil)
169 12ca62f2 2020-12-26 op (const :tag "None" t)
170 12ca62f2 2020-12-26 op (string :tag "Argument String")
171 6eea6cfb 2021-01-05 op (repeat :tag "Argument List" :value ("") string)))
172 12ca62f2 2020-12-26 op
173 af5ef7cd 2020-11-29 op ;; helpers
174 95a78ecb 2021-08-31 op (defmacro vc-got--with-emacs-version<= (version &rest body)
175 95a78ecb 2021-08-31 op "Eval BODY only when the Emacs version in greater or equal VERSION."
176 95a78ecb 2021-08-31 op (declare (debug body)
177 95a78ecb 2021-08-31 op (indent defun))
178 95a78ecb 2021-08-31 op (when (version<= version emacs-version)
179 95a78ecb 2021-08-31 op `(progn ,@body)))
180 95a78ecb 2021-08-31 op
181 6fd5fa32 2022-06-08 op (defun vc-got--version ()
182 76d978fa 2021-01-05 op "Return string representing the got version."
183 f09d6359 2020-12-31 noreply (let (process-file-side-effects)
184 f09d6359 2020-12-31 noreply (with-temp-buffer
185 f09d6359 2020-12-31 noreply (vc-got--call "-V")
186 f09d6359 2020-12-31 noreply (substring (buffer-string) 4 -1))))
187 6fd5fa32 2022-06-08 op
188 6fd5fa32 2022-06-08 op (defun vc-got--version<= (target)
189 6fd5fa32 2022-06-08 op "Compare the current version against TARGET.
190 6fd5fa32 2022-06-08 op Takes care of handling the -current suffix."
191 6fd5fa32 2022-06-08 op (let* ((version-string (vc-got--version))
192 6fd5fa32 2022-06-08 op (current-version (string-replace "-current" "" version-string)))
193 6fd5fa32 2022-06-08 op (when (version<= current-version target)
194 6fd5fa32 2022-06-08 op ;; let X.Y-current sort *after* X.Y
195 6fd5fa32 2022-06-08 op (string= version-string current-version))))
196 af5ef7cd 2020-11-29 op
197 af5ef7cd 2020-11-29 op (defun vc-got-root (file)
198 af5ef7cd 2020-11-29 op "Return the work tree root for FILE, or nil."
199 6a973a79 2021-08-11 op (vc-find-root file ".got"))
200 af5ef7cd 2020-11-29 op
201 af5ef7cd 2020-11-29 op (defmacro vc-got-with-worktree (file &rest body)
202 af5ef7cd 2020-11-29 op "Evaluate BODY in the work tree directory of FILE."
203 3efc7598 2021-09-09 op (declare (debug t) (indent defun))
204 af5ef7cd 2020-11-29 op `(when-let (default-directory (vc-got-root ,file))
205 af5ef7cd 2020-11-29 op ,@body))
206 686eac9a 2020-12-07 op
207 686eac9a 2020-12-07 op (defun vc-got--repo-root ()
208 686eac9a 2020-12-07 op "Return the path to the repository root.
209 686eac9a 2020-12-07 op Assume `default-directory' is inside a got worktree."
210 686eac9a 2020-12-07 op (vc-got-with-worktree default-directory
211 686eac9a 2020-12-07 op (with-temp-buffer
212 686eac9a 2020-12-07 op (insert-file-contents ".got/repository")
213 76d978fa 2021-01-05 op (string-trim (buffer-string) "" "\n"))))
214 af5ef7cd 2020-11-29 op
215 af5ef7cd 2020-11-29 op (defun vc-got--call (&rest args)
216 76d978fa 2021-01-05 op "Call `vc-got-program' with ARGS.
217 76d978fa 2021-01-05 op The output will be placed in the current buffer."
218 fab791a2 2020-01-03 op (apply #'process-file vc-got-program nil (current-buffer) nil
219 3efc7598 2021-09-09 op (apply #'nconc (mapcar (lambda (s) (if (listp s) s (list s))) args))))
220 af5ef7cd 2020-11-29 op
221 23a0b465 2020-11-30 op (defun vc-got--add (files)
222 23a0b465 2020-11-30 op "Add FILES to got, passing `vc-register-switches' to the command invocation."
223 23a0b465 2020-11-30 op (with-temp-buffer
224 c3185bf7 2021-08-11 op (vc-got--call "add" vc-register-switches "--" files)))
225 9b53f629 2022-08-05 op
226 9b53f629 2022-08-05 op (defun vc-got--info (path)
227 9b53f629 2022-08-05 op "Execute got info in the worktree of PATH in the current buffer."
228 9b53f629 2022-08-05 op (let* ((process-file-side-effects nil))
229 9b53f629 2022-08-05 op (vc-got-with-worktree path
230 9b53f629 2022-08-05 op (zerop (save-excursion
231 9b53f629 2022-08-05 op (vc-got--call "info" "--" path))))))
232 23a0b465 2020-11-30 op
233 0a66694e 2020-01-02 op (defun vc-got--log (&optional path limit start-commit stop-commit
234 32819756 2021-09-14 op search-pattern reverse include-diff)
235 76d978fa 2021-01-05 op "Execute the log command in the worktree of PATH in the current buffer.
236 23a0b465 2020-11-30 op LIMIT limits the maximum number of commit returned.
237 23a0b465 2020-11-30 op
238 518ede14 2020-12-05 op START-COMMIT: start traversing history at the specified commit.
239 9ad1eb5d 2020-12-07 op STOP-COMMIT: stop traversing history at the specified commit.
240 518ede14 2020-12-05 op SEARCH-PATTERN: limit to log messages matched by the regexp given.
241 0a66694e 2020-01-02 op REVERSE: display the log messages in reverse order.
242 32819756 2021-09-14 op INCLUDE-DIFF: display the patch of modifications made in each commit.
243 518ede14 2020-12-05 op
244 23a0b465 2020-11-30 op Return nil if the command failed or if PATH isn't included in any
245 23a0b465 2020-11-30 op worktree."
246 6fd5fa32 2022-06-08 op (let* ((process-file-side-effects nil)
247 6fd5fa32 2022-06-08 op ;; got 0.71-current at some point switched to -S for search
248 6fd5fa32 2022-06-08 op ;; pattern and -s for the one-line format.
249 6fd5fa32 2022-06-08 op ;; XXX: remove in a few releases.
250 6fd5fa32 2022-06-08 op (search-flag (if (vc-got--version<= "0.71")
251 6fd5fa32 2022-06-08 op "-s"
252 6fd5fa32 2022-06-08 op "-S")))
253 0a66694e 2020-01-02 op (vc-got-with-worktree (or path default-directory)
254 0a3316a6 2021-02-22 op (when (zerop
255 0a3316a6 2021-02-22 op (save-excursion
256 0a3316a6 2021-02-22 op (vc-got--call "log"
257 3efc7598 2021-09-09 op (and limit (list "-l" (format "%s" limit)))
258 3efc7598 2021-09-09 op (and start-commit (list "-c" start-commit))
259 3efc7598 2021-09-09 op (and stop-commit (list "-x" stop-commit))
260 6fd5fa32 2022-06-08 op (and search-pattern (list search-flag
261 6fd5fa32 2022-06-08 op search-pattern))
262 3efc7598 2021-09-09 op (and reverse '("-R"))
263 32819756 2021-09-14 op (and include-diff '("-p"))
264 32819756 2021-09-14 op ;; "--"
265 0a3316a6 2021-02-22 op path)))
266 0a3316a6 2021-02-22 op (save-excursion
267 3ec8a8b4 2021-08-17 op (delete-matching-lines
268 3ec8a8b4 2021-08-17 op "^-----------------------------------------------$")
269 0a3316a6 2021-02-22 op t)))))
270 af5ef7cd 2020-11-29 op
271 887e0699 2021-02-22 op (defun vc-got--status (status-codes dir-or-file &optional files)
272 dd4e6a2c 2022-05-28 op "Return a list of lists (FILE STATUS STAGE-STATUS).
273 af5ef7cd 2020-11-29 op DIR-OR-FILE can be either a directory or a file. If FILES is
274 af5ef7cd 2020-11-29 op given, return the status of those files, otherwise the status of
275 668dc8eb 2021-01-04 op DIR-OR-FILE. STATUS-CODES is either nil, or a string that's
276 668dc8eb 2021-01-04 op passed as the -s flag to got status to limit the types of status
277 668dc8eb 2021-01-04 op to report (e.g. \"CD\" to report only conflicts and deleted
278 668dc8eb 2021-01-04 op files)."
279 2d039a22 2021-02-21 op (with-temp-buffer
280 2d039a22 2021-02-21 op (let* ((default-directory (expand-file-name
281 2d039a22 2021-02-21 op (if (file-directory-p dir-or-file)
282 2d039a22 2021-02-21 op dir-or-file
283 2d039a22 2021-02-21 op (file-name-directory dir-or-file))))
284 2d039a22 2021-02-21 op (root (vc-got-root default-directory))
285 2d039a22 2021-02-21 op (process-file-side-effects))
286 2d039a22 2021-02-21 op (when (zerop (vc-got--call "status"
287 3efc7598 2021-09-09 op (and status-codes (list "-s" status-codes))
288 c3185bf7 2021-08-11 op "--"
289 2d039a22 2021-02-21 op (or files dir-or-file)))
290 2d039a22 2021-02-21 op (goto-char (point-min))
291 2d039a22 2021-02-21 op (cl-loop until (eobp)
292 3ec8a8b4 2021-08-17 op collect (vc-got--parse-status-line root)
293 2d039a22 2021-02-21 op do (forward-line))))))
294 3ec8a8b4 2021-08-17 op
295 3ec8a8b4 2021-08-17 op (defun vc-got--parse-status-line (root)
296 3ec8a8b4 2021-08-17 op "Parse a line of the the output of status.
297 3ec8a8b4 2021-08-17 op ROOT is the root of the repo."
298 3ec8a8b4 2021-08-17 op ;; the format of each line is
299 3ec8a8b4 2021-08-17 op ;; <status-char> <stage-char> <spc> <filename> \n
300 3ec8a8b4 2021-08-17 op (let* ((file-status (prog1 (vc-got--parse-status-char
301 3ec8a8b4 2021-08-17 op (char-after))
302 3ec8a8b4 2021-08-17 op (forward-char)))
303 3ec8a8b4 2021-08-17 op (stage-status (let* ((c (char-after)))
304 3ec8a8b4 2021-08-17 op (prog1
305 3ec8a8b4 2021-08-17 op (when (member c '(?M ?A ?D))
306 3ec8a8b4 2021-08-17 op c)
307 3ec8a8b4 2021-08-17 op (forward-char))))
308 3ec8a8b4 2021-08-17 op (filename (progn
309 3ec8a8b4 2021-08-17 op (forward-char)
310 3ec8a8b4 2021-08-17 op (buffer-substring (point)
311 3ec8a8b4 2021-08-17 op (line-end-position)))))
312 3ec8a8b4 2021-08-17 op (list (file-relative-name (expand-file-name filename root)
313 3ec8a8b4 2021-08-17 op default-directory)
314 3ec8a8b4 2021-08-17 op (or file-status (and stage-status 'up-to-date))
315 3ec8a8b4 2021-08-17 op stage-status)))
316 af5ef7cd 2020-11-29 op
317 668dc8eb 2021-01-04 op (defun vc-got--parse-status-char (c)
318 668dc8eb 2021-01-04 op "Parse status char C into a symbol accepted by `vc-state'."
319 668dc8eb 2021-01-04 op (cl-case c
320 668dc8eb 2021-01-04 op (?M 'edited)
321 668dc8eb 2021-01-04 op (?A 'added)
322 668dc8eb 2021-01-04 op (?D 'removed)
323 668dc8eb 2021-01-04 op (?C 'conflict)
324 668dc8eb 2021-01-04 op (?! 'missing)
325 e8e0be92 2022-09-22 op (?~ 'edited) ; file was replaced by e.g. a directory
326 668dc8eb 2021-01-04 op (?? 'unregistered)
327 76d978fa 2021-01-05 op (?m 'edited) ; modified file modes
328 668dc8eb 2021-01-04 op (?N nil)))
329 23a0b465 2020-11-30 op
330 23a0b465 2020-11-30 op (defun vc-got--cat (commit obj-id)
331 23a0b465 2020-11-30 op "Execute got cat -c COMMIT OBJ-ID in the current buffer."
332 76d978fa 2021-01-05 op (let (process-file-side-effects)
333 76d978fa 2021-01-05 op (zerop (vc-got--call "cat" "-c" commit obj-id))))
334 eb85ad27 2020-12-05 op
335 eb85ad27 2020-12-05 op (defun vc-got--revert (&rest files)
336 76d978fa 2021-01-05 op "Execute got revert FILES."
337 eb85ad27 2020-12-05 op (vc-got-with-worktree (car files)
338 eb85ad27 2020-12-05 op (with-temp-buffer
339 c3185bf7 2021-08-11 op (zerop (vc-got--call "revert" "--" files)))))
340 eb85ad27 2020-12-05 op
341 eb85ad27 2020-12-05 op (defun vc-got--list-branches ()
342 eb85ad27 2020-12-05 op "Return an alist of (branch . commit)."
343 76d978fa 2021-01-05 op (let (process-file-side-effects)
344 76d978fa 2021-01-05 op (with-temp-buffer
345 76d978fa 2021-01-05 op (when (zerop (vc-got--call "branch" "-l"))
346 3efc7598 2021-09-09 op (let (alist)
347 3efc7598 2021-09-09 op (goto-char (point-min))
348 660cf35d 2021-09-25 op (while (re-search-forward "^\\*?[[:space:]]+\\(.+\\): \\([[:word:]]+\\)$"
349 660cf35d 2021-09-25 op nil t)
350 3efc7598 2021-09-09 op (push (cons (match-string 1) (match-string 2)) alist))
351 3efc7598 2021-09-09 op alist)))))
352 eb85ad27 2020-12-05 op
353 694534b4 2020-12-05 op (defun vc-got--current-branch ()
354 694534b4 2020-12-05 op "Return the current branch."
355 76d978fa 2021-01-05 op (let (process-file-side-effects)
356 76d978fa 2021-01-05 op (with-temp-buffer
357 76d978fa 2021-01-05 op (when (zerop (vc-got--call "branch"))
358 76d978fa 2021-01-05 op (string-trim (buffer-string) "" "\n")))))
359 eb85ad27 2020-12-05 op
360 eb85ad27 2020-12-05 op (defun vc-got--integrate (branch)
361 eb85ad27 2020-12-05 op "Integrate BRANCH into the current one."
362 eb85ad27 2020-12-05 op (with-temp-buffer
363 76d978fa 2021-01-05 op (zerop (vc-got--call "integrate" branch))))
364 db89d6fd 2021-08-16 op
365 db89d6fd 2021-08-16 op (defun vc-got--update (branch &optional paths)
366 db89d6fd 2021-08-16 op "Update to a different commit or BRANCH.
367 db89d6fd 2021-08-16 op Optionally restrict the update operation to files at or within
368 db89d6fd 2021-08-16 op the specified PATHS."
369 db89d6fd 2021-08-16 op (with-temp-buffer
370 db89d6fd 2021-08-16 op (unless (zerop (vc-got--call "update" "-b" branch "--" paths))
371 db89d6fd 2021-08-16 op (error "[vc-got] can't update to branch %s: %s"
372 db89d6fd 2021-08-16 op branch
373 db89d6fd 2021-08-16 op (buffer-string)))))
374 23a0b465 2020-11-30 op
375 45f7f941 2021-11-09 op (defun vc-got--diff-files (files)
376 36e5655f 2021-11-09 op "Compute the local modifications to FILES."
377 76d978fa 2021-01-05 op (let (process-file-side-effects)
378 36e5655f 2021-11-09 op (zerop (vc-got--call "diff" (vc-switches 'got 'diff) "-P" "--"
379 36e5655f 2021-11-09 op files))))
380 6b6c8a78 2021-01-04 op
381 36e5655f 2021-11-09 op (defun vc-got--diff-objects (obj1 obj2)
382 36e5655f 2021-11-09 op "Diff the two objects OBJ1 and OBJ2.
383 36e5655f 2021-11-09 op OBJ1 and OBJ2 are interpreted as a reference, tag name, or an
384 36e5655f 2021-11-09 op object ID SHA1 hash."
385 36e5655f 2021-11-09 op (let (process-file-side-effects)
386 36e5655f 2021-11-09 op (zerop (vc-got--call "diff" (vc-switches 'got 'diff) "--" obj1 obj2))))
387 36e5655f 2021-11-09 op
388 6b6c8a78 2021-01-04 op (defun vc-got--unstage (file-or-directory)
389 6b6c8a78 2021-01-04 op "Unstage all the staged hunks at or within FILE-OR-DIRECTORY.
390 6b6c8a78 2021-01-04 op If it's nil, unstage every staged changes across the entire work
391 6b6c8a78 2021-01-04 op tree."
392 c3185bf7 2021-08-11 op (zerop (vc-got--call "unstage" "--" file-or-directory)))
393 a96df0e8 2020-01-03 noreply
394 a96df0e8 2020-01-03 noreply (defun vc-got--remove (file &optional force keep-local)
395 76d978fa 2021-01-05 op "Use got to remove FILE.
396 76d978fa 2021-01-05 op If FORCE is non-nil perform the operation even if a file contains
397 76d978fa 2021-01-05 op local modification. If KEEP-LOCAL is non-nil keep the affected
398 76d978fa 2021-01-05 op files on disk."
399 a96df0e8 2020-01-03 noreply (vc-got-with-worktree (or file default-directory)
400 a96df0e8 2020-01-03 noreply (with-temp-buffer
401 76d978fa 2021-01-05 op (zerop (vc-got--call "remove"
402 3efc7598 2021-09-09 op (and force "-f")
403 3efc7598 2021-09-09 op (and keep-local "-k")
404 c3185bf7 2021-08-11 op "--"
405 76d978fa 2021-01-05 op file)))))
406 eb85ad27 2020-12-05 op
407 5fb2f474 2021-08-10 op (defun vc-got--ref ()
408 5fb2f474 2021-08-10 op "Return a list of all references."
409 3efc7598 2021-09-09 op (let ((process-file-side-effects nil)
410 5fb2f474 2021-08-10 op (re "^refs/\\(heads\\|remotes\\|tags\\)/\\(.*\\):")
411 5fb2f474 2021-08-10 op ;; hardcoding HEAD because it's always present and the regexp
412 5fb2f474 2021-08-10 op ;; won't match it.
413 5fb2f474 2021-08-10 op (table (list "HEAD")))
414 5fb2f474 2021-08-10 op (vc-got-with-worktree default-directory
415 5fb2f474 2021-08-10 op (with-temp-buffer
416 5fb2f474 2021-08-10 op (when (zerop (vc-got--call "ref" "-l"))
417 5fb2f474 2021-08-10 op (goto-char (point-min))
418 5fb2f474 2021-08-10 op (while (re-search-forward re nil t)
419 5fb2f474 2021-08-10 op (push (match-string 2) table))
420 5fb2f474 2021-08-10 op table)))))
421 8014bde1 2021-08-10 op
422 8014bde1 2021-08-10 op (defun vc-got--branch (name)
423 8014bde1 2021-08-10 op "Try to create and switch to the branch called NAME."
424 8014bde1 2021-08-10 op (let (process-file-side-effects)
425 8014bde1 2021-08-10 op (vc-got-with-worktree default-directory
426 8014bde1 2021-08-10 op (with-temp-buffer
427 f0d7c7e7 2022-05-28 op (or (zerop (vc-got--call "branch" "--" name))
428 f0d7c7e7 2022-05-28 op (error "[vc-got] can't create branch %s: %s" name
429 f0d7c7e7 2022-05-28 op (buffer-string)))))))
430 5fb2f474 2021-08-10 op
431 af5ef7cd 2020-11-29 op
432 af5ef7cd 2020-11-29 op ;; Backend properties
433 af5ef7cd 2020-11-29 op
434 af5ef7cd 2020-11-29 op (defun vc-got-revision-granularity ()
435 af5ef7cd 2020-11-29 op "Got has REPOSITORY granularity."
436 af5ef7cd 2020-11-29 op 'repository)
437 af5ef7cd 2020-11-29 op
438 af5ef7cd 2020-11-29 op (defun vc-got-update-on-retrieve-tag ()
439 84beb0d4 2021-08-17 op "Like vc-git, vc-got don't need to buffers on `retrieve-tag'."
440 af5ef7cd 2020-11-29 op nil)
441 af5ef7cd 2020-11-29 op
442 af5ef7cd 2020-11-29 op
443 af5ef7cd 2020-11-29 op ;; State-querying functions
444 af5ef7cd 2020-11-29 op
445 af5ef7cd 2020-11-29 op ;;;###autoload (defun vc-got-registered (file)
446 af5ef7cd 2020-11-29 op ;;;###autoload "Return non-nil if FILE is registered with got."
447 af5ef7cd 2020-11-29 op ;;;###autoload (when (vc-find-root file ".got")
448 af5ef7cd 2020-11-29 op ;;;###autoload (load "vc-got" nil t)
449 af5ef7cd 2020-11-29 op ;;;###autoload (vc-got-registered file)))
450 af5ef7cd 2020-11-29 op
451 af5ef7cd 2020-11-29 op (defun vc-got-registered (file)
452 af5ef7cd 2020-11-29 op "Return non-nil if FILE is registered with got."
453 af5ef7cd 2020-11-29 op (if (file-directory-p file)
454 76d978fa 2021-01-05 op nil ; got doesn't track directories
455 4093d2f9 2020-12-04 op (when (vc-find-root file ".got")
456 668dc8eb 2021-01-04 op (let ((s (vc-got-state file)))
457 f0d7c7e7 2022-05-28 op (not (memq s '(nil unregistered)))))))
458 af5ef7cd 2020-11-29 op
459 af5ef7cd 2020-11-29 op (defun vc-got-state (file)
460 af5ef7cd 2020-11-29 op "Return the current version control state of FILE. See `vc-state'."
461 af5ef7cd 2020-11-29 op (unless (file-directory-p file)
462 76d978fa 2021-01-05 op (let (process-file-side-effects)
463 76d978fa 2021-01-05 op ;; Manually calling got status and checking the result inline to
464 76d978fa 2021-01-05 op ;; avoid building the data structure in vc-got--status.
465 76d978fa 2021-01-05 op (with-temp-buffer
466 c3185bf7 2021-08-11 op (when (zerop (vc-got--call "status" "--" file))
467 76d978fa 2021-01-05 op (goto-char (point-min))
468 76d978fa 2021-01-05 op (if (eobp)
469 76d978fa 2021-01-05 op 'up-to-date
470 76d978fa 2021-01-05 op (vc-got--parse-status-char (char-after))))))))
471 dcb5b83a 2021-01-08 op
472 dcb5b83a 2021-01-08 op (defun vc-got--dir-filter-files (files)
473 dcb5b83a 2021-01-08 op "Remove ., .. and .got from FILES."
474 dcb5b83a 2021-01-08 op (cl-loop for file in files
475 dcb5b83a 2021-01-08 op unless (or (string= file "..")
476 dcb5b83a 2021-01-08 op (string= file ".")
477 dcb5b83a 2021-01-08 op (string= file ".got"))
478 dcb5b83a 2021-01-08 op collect file))
479 af5ef7cd 2020-11-29 op
480 af5ef7cd 2020-11-29 op (defun vc-got-dir-status-files (dir files update-function)
481 5b4a6b90 2021-01-04 op "Build the status for FILES in DIR.
482 76d978fa 2021-01-05 op The builded result is given to the callback UPDATE-FUNCTION. If
483 5b4a6b90 2021-01-04 op FILES is nil, consider all the files in DIR."
484 dcb5b83a 2021-01-08 op (let* ((fs (vc-got--dir-filter-files (or files (directory-files dir))))
485 d346ca63 2021-01-08 op ;; XXX: we call with files, wich will probably be nil on the
486 d346ca63 2021-01-08 op ;; first run, so we catch deleted, missing and edited files
487 d346ca63 2021-01-08 op ;; in subdirectories.
488 d346ca63 2021-01-08 op (res (vc-got--status nil dir files))
489 d346ca63 2021-01-08 op double-check)
490 82289421 2020-01-02 op (cl-loop for file in fs
491 76d978fa 2021-01-05 op do (when (and (not (cdr (assoc file res #'string=)))
492 76d978fa 2021-01-05 op (not (file-directory-p file))
493 76d978fa 2021-01-05 op ;; if file doesn't exists, it's a
494 76d978fa 2021-01-05 op ;; untracked file that was removed.
495 76d978fa 2021-01-05 op (file-exists-p file))
496 d346ca63 2021-01-08 op ;; if we don't know the status of a file here, it's
497 d346ca63 2021-01-08 op ;; either up-to-date or ignored. Save it for a
498 d346ca63 2021-01-08 op ;; double check
499 d346ca63 2021-01-08 op (push file double-check)))
500 cb973832 2021-01-08 op (cl-loop with statuses = (vc-got--status nil dir double-check)
501 cb973832 2021-01-08 op for file in double-check
502 cb973832 2021-01-08 op unless (eq 'unregistered (cadr (assoc file statuses #'string=)))
503 d346ca63 2021-01-08 op do (push (list file 'up-to-date nil) res))
504 d346ca63 2021-01-08 op (funcall update-function res nil)))
505 af5ef7cd 2020-11-29 op
506 c27df03e 2020-01-03 op (defun vc-got-dir-extra-headers (dir)
507 c27df03e 2020-01-03 op "Return a string for the `vc-dir' buffer heading for directory DIR."
508 76d978fa 2021-01-05 op (let ((remote (vc-got-repository-url dir)))
509 76d978fa 2021-01-05 op (concat (propertize "Repository : " 'face 'font-lock-type-face)
510 76d978fa 2021-01-05 op (vc-got--repo-root) "\n"
511 76d978fa 2021-01-05 op (when remote
512 76d978fa 2021-01-05 op (concat
513 76d978fa 2021-01-05 op (propertize "Remote URL : " 'face 'font-lock-type-face)
514 76d978fa 2021-01-05 op (vc-got-repository-url dir) "\n"))
515 76d978fa 2021-01-05 op (propertize "Branch : " 'face 'font-lock-type-face)
516 76d978fa 2021-01-05 op (vc-got--current-branch))))
517 2d83de2e 2021-01-05 op
518 2d83de2e 2021-01-05 op (defun vc-got-dir-printer (info)
519 2d83de2e 2021-01-05 op "Pretty-printer for the vc-dir-fileinfo structure INFO."
520 2d83de2e 2021-01-05 op (let* ((isdir (vc-dir-fileinfo->directory info))
521 76d978fa 2021-01-05 op (state (if isdir "" (vc-dir-fileinfo->state info)))
522 76d978fa 2021-01-05 op (stage-state (vc-dir-fileinfo->extra info))
523 76d978fa 2021-01-05 op (filename (vc-dir-fileinfo->name info)))
524 2d83de2e 2021-01-05 op (insert
525 1b2afa91 2021-08-17 op " "
526 2d83de2e 2021-01-05 op (propertize
527 2d83de2e 2021-01-05 op (format "%c" (if (vc-dir-fileinfo->marked info) ?* ? ))
528 2d83de2e 2021-01-05 op 'face 'font-lock-type-face)
529 1b2afa91 2021-08-17 op " "
530 9e019413 2021-01-05 op (propertize
531 1b2afa91 2021-08-17 op (format "%-12s" state)
532 2d83de2e 2021-01-05 op 'face (cond ((eq state 'up-to-date) 'font-lock-builtin-face)
533 76d978fa 2021-01-05 op ((memq state '(missing conflict)) 'font-lock-warning-face)
534 76d978fa 2021-01-05 op ((eq state 'edited) 'font-lock-constant-face)
535 76d978fa 2021-01-05 op (t 'font-lock-variable-name-face))
536 1b2afa91 2021-08-17 op 'mouse-face 'highlight
537 95a78ecb 2021-08-31 op 'keymap (vc-got--with-emacs-version<= "28.0.50"
538 95a78ecb 2021-08-31 op vc-dir-status-mouse-map))
539 1b2afa91 2021-08-17 op " " (propertize
540 1b2afa91 2021-08-17 op (if stage-state
541 1b2afa91 2021-08-17 op (format "%c" stage-state)
542 1b2afa91 2021-08-17 op " ")
543 1b2afa91 2021-08-17 op 'face (cond ((memq stage-state '(?A ?E)) 'font-lock-constant-face)
544 1b2afa91 2021-08-17 op ((eq stage-state ?R) 'font-lock-warning-face)
545 1b2afa91 2021-08-17 op (t 'font-lock-variable-name-face)))
546 1b2afa91 2021-08-17 op " "
547 1b2afa91 2021-08-17 op (propertize filename
548 1b2afa91 2021-08-17 op 'face (if isdir 'font-lock-comment-delimiter-face
549 1b2afa91 2021-08-17 op 'font-lock-function-name-face)
550 1b2afa91 2021-08-17 op 'help-echo
551 1b2afa91 2021-08-17 op (if isdir
552 3ec8a8b4 2021-08-17 op (concat
553 3ec8a8b4 2021-08-17 op "Directory\n"
554 3ec8a8b4 2021-08-17 op "VC operations can be applied to it\n"
555 3ec8a8b4 2021-08-17 op "mouse-3: Pop-up menu")
556 1b2afa91 2021-08-17 op "File\nmouse-3: Pop-up menu")
557 1b2afa91 2021-08-17 op 'mouse-face 'highlight
558 1b2afa91 2021-08-17 op 'keymap vc-dir-filename-mouse-map))))
559 1b2afa91 2021-08-17 op
560 af5ef7cd 2020-11-29 op (defun vc-got-working-revision (file)
561 3ec8a8b4 2021-08-17 op "Return the last commit that touched FILE or \"0\" if it's newly added."
562 9b53f629 2022-08-05 op (with-temp-buffer
563 9b53f629 2022-08-05 op (when (vc-got--info file)
564 9b53f629 2022-08-05 op (let ((pos (re-search-forward "^based on commit: " nil t)))
565 9b53f629 2022-08-05 op (if pos
566 9b53f629 2022-08-05 op (buffer-substring-no-properties pos (line-end-position))
567 9b53f629 2022-08-05 op "0")))))
568 af5ef7cd 2020-11-29 op
569 af5ef7cd 2020-11-29 op (defun vc-got-checkout-model (_files)
570 01bf4e07 2021-08-17 op "Return the checkout model.
571 01bf4e07 2021-08-17 op Got uses an implicit checkout model for every file."
572 af5ef7cd 2020-11-29 op 'implicit)
573 af5ef7cd 2020-11-29 op
574 694534b4 2020-12-05 op (defun vc-got-mode-line-string (file)
575 694534b4 2020-12-05 op "Return the VC mode line string for FILE."
576 694534b4 2020-12-05 op (vc-got-with-worktree file
577 694534b4 2020-12-05 op (let ((def (vc-default-mode-line-string 'Got file)))
578 694534b4 2020-12-05 op (concat (substring def 0 4) (vc-got--current-branch)))))
579 694534b4 2020-12-05 op
580 23a0b465 2020-11-30 op
581 23a0b465 2020-11-30 op ;; state-changing functions
582 23a0b465 2020-11-30 op
583 23a0b465 2020-11-30 op (defun vc-got-create-repo (_backend)
584 7726b6c9 2021-08-10 op "Create an empty repository in the current directory."
585 7726b6c9 2021-08-10 op (error "[vc-got] create-repo not implemented"))
586 23a0b465 2020-11-30 op
587 23a0b465 2020-11-30 op (defun vc-got-register (files &optional _comment)
588 23a0b465 2020-11-30 op "Register FILES, passing `vc-register-switches' to the backend command."
589 23a0b465 2020-11-30 op (vc-got--add files))
590 23a0b465 2020-11-30 op
591 9e805da8 2020-11-30 op (defalias 'vc-got-responsible-p #'vc-got-root)
592 241a3b12 2021-08-11 op
593 241a3b12 2021-08-11 op (defun vc-got-unregister (file)
594 241a3b12 2021-08-11 op "Unregister FILE."
595 9114bbc3 2021-08-11 op (vc-got--remove file t t))
596 23a0b465 2020-11-30 op
597 23a0b465 2020-11-30 op (defun vc-got-checkin (files comment &optional _rev)
598 23a0b465 2020-11-30 op "Commit FILES with COMMENT as commit message."
599 23a0b465 2020-11-30 op (with-temp-buffer
600 ad36649b 2021-02-25 op (unless (zerop (vc-got--call "commit" "-m"
601 489c6310 2022-07-26 op (log-edit-extract-headers
602 489c6310 2022-07-26 op '(("Author" . "-A"))
603 489c6310 2022-07-26 op comment)
604 c3185bf7 2021-08-11 op "--"
605 ad36649b 2021-02-25 op files))
606 26362bf0 2021-08-11 op (error "[vc-got] can't commit: %s" (buffer-string)))))
607 23a0b465 2020-11-30 op
608 23a0b465 2020-11-30 op (defun vc-got-find-revision (file rev buffer)
609 c0c9a339 2020-12-04 op "Fill BUFFER with the content of FILE in the given revision REV."
610 961d35b5 2021-09-09 op (with-current-buffer buffer
611 961d35b5 2021-09-09 op (vc-got-with-worktree file
612 961d35b5 2021-09-09 op (vc-got--cat rev (file-relative-name file)))))
613 55091167 2020-12-05 op
614 eb85ad27 2020-12-05 op (defun vc-got-checkout (_file &optional _rev)
615 76d978fa 2021-01-05 op "Checkout revision REV of FILE.
616 76d978fa 2021-01-05 op If REV is t, checkout from the head."
617 7726b6c9 2021-08-10 op (error "[vc-got] checkout not implemented"))
618 eb85ad27 2020-12-05 op
619 eb85ad27 2020-12-05 op (defun vc-got-revert (file &optional _content-done)
620 eb85ad27 2020-12-05 op "Revert FILE back to working revision."
621 eb85ad27 2020-12-05 op (vc-got--revert file))
622 eb85ad27 2020-12-05 op
623 eb85ad27 2020-12-05 op (defun vc-got-merge-branch ()
624 eb85ad27 2020-12-05 op "Prompt for a branch and integrate it into the current one."
625 eb85ad27 2020-12-05 op ;; XXX: be smart and try to "got rebase" if "got integrate" fails?
626 eb85ad27 2020-12-05 op (let* ((branches (cl-loop for (branch . commit) in (vc-got--list-branches)
627 eb85ad27 2020-12-05 op collect branch))
628 eb85ad27 2020-12-05 op (branch (completing-read "Merge from branch: " branches)))
629 eb85ad27 2020-12-05 op (when branch
630 eb85ad27 2020-12-05 op (vc-got--integrate branch))))
631 686eac9a 2020-12-07 op
632 74b00009 2021-08-31 op (defun vc-got--proc-filter (proc s)
633 74b00009 2021-08-31 op "Custom output filter for async process PROC.
634 74b00009 2021-08-31 op It's like `vc-process-filter' but supports \r inside S."
635 74b00009 2021-08-31 op (let ((buffer (process-buffer proc)))
636 74b00009 2021-08-31 op (when (buffer-live-p buffer)
637 74b00009 2021-08-31 op (with-current-buffer buffer
638 74b00009 2021-08-31 op (save-excursion
639 74b00009 2021-08-31 op (let ((buffer-undo-list t)
640 74b00009 2021-08-31 op (inhibit-read-only t))
641 74b00009 2021-08-31 op (goto-char (process-mark proc))
642 74b00009 2021-08-31 op (if (not (string-match ".*\r\\(.*\\)" s))
643 74b00009 2021-08-31 op (insert s)
644 74b00009 2021-08-31 op ;; handle \r
645 74b00009 2021-08-31 op (end-of-line)
646 74b00009 2021-08-31 op (let ((end (point)))
647 74b00009 2021-08-31 op (beginning-of-line)
648 74b00009 2021-08-31 op (delete-region (point) end))
649 74b00009 2021-08-31 op (insert (match-string 1 s)))
650 74b00009 2021-08-31 op (set-marker (process-mark proc) (point))))))))
651 74b00009 2021-08-31 op
652 dec54a74 2021-02-21 op (defun vc-got--push-pull (cmd op prompt)
653 dec54a74 2021-02-21 op "Execute CMD OP, or prompt the user if PROMPT is non-nil."
654 dec54a74 2021-02-21 op (let ((buffer (format "*vc-got : %s*" (expand-file-name default-directory))))
655 686eac9a 2020-12-07 op (when-let (cmd (if prompt
656 686eac9a 2020-12-07 op (split-string
657 686eac9a 2020-12-07 op (read-shell-command (format "%s %s command: " cmd op)
658 1870c8bd 2021-03-27 op (format "%s %s " cmd op))
659 686eac9a 2020-12-07 op " " t)
660 686eac9a 2020-12-07 op (list cmd op)))
661 dec54a74 2021-02-21 op (apply #'vc-do-async-command buffer default-directory cmd)
662 dec54a74 2021-02-21 op (with-current-buffer buffer
663 74b00009 2021-08-31 op (vc-compilation-mode 'got)
664 74b00009 2021-08-31 op (let ((comp-cmd (mapconcat #'identity cmd " "))
665 74b00009 2021-08-31 op (proc (get-buffer-process buffer)))
666 95a78ecb 2021-08-31 op (setq-local compile-command comp-cmd)
667 95a78ecb 2021-08-31 op (setq-local compilation-directory default-directory)
668 95a78ecb 2021-08-31 op (setq-local compilation-arguments (list comp-cmd
669 dec54a74 2021-02-21 op nil
670 dec54a74 2021-02-21 op (lambda (_ign) buffer)
671 74b00009 2021-08-31 op nil))
672 74b00009 2021-08-31 op ;; Setup a custom process filter that handles \r.
673 74b00009 2021-08-31 op (set-process-filter proc #'vc-got--proc-filter)))
674 dec54a74 2021-02-21 op (vc-set-async-update buffer))))
675 eb85ad27 2020-12-05 op
676 3ec8a8b4 2021-08-17 op ;; TODO: this could be expanded. After a pull the worktree needs to
677 95782f5b 2022-02-01 op ;; be updated, either with a ``got update -b branch-name'' or ``got
678 95782f5b 2022-02-01 op ;; update -b remote/branchname'' plus a rebase.
679 eb85ad27 2020-12-05 op (defun vc-got-pull (prompt)
680 16a2f37b 2022-05-28 op "Execute a fetch prompting for the full command if PROMPT is not nil."
681 e4ac2ae5 2021-10-04 op (vc-got--push-pull vc-got-program "fetch" prompt))
682 686eac9a 2020-12-07 op
683 686eac9a 2020-12-07 op (defun vc-got-push (prompt)
684 16a2f37b 2022-05-28 op "Execute a send prompting for the full command if PROMPT is not nil."
685 e4ac2ae5 2021-10-04 op (vc-got--push-pull vc-got-program "send" prompt))
686 eb85ad27 2020-12-05 op
687 424f5152 2021-08-10 op
688 424f5152 2021-08-10 op ;; History functions
689 424f5152 2021-08-10 op
690 eb85ad27 2020-12-05 op (defun vc-got-print-log (files buffer &optional _shortlog start-revision limit)
691 eb85ad27 2020-12-05 op "Insert the revision log for FILES into BUFFER.
692 76d978fa 2021-01-05 op LIMIT limits the number of commits, optionally starting at
693 76d978fa 2021-01-05 op START-REVISION."
694 2217122f 2022-07-19 op (vc-setup-buffer buffer)
695 eb85ad27 2020-12-05 op (with-current-buffer buffer
696 ba51d241 2022-07-23 op (let ((worktree-path (vc-got-root default-directory))
697 ba51d241 2022-07-23 op (inhibit-read-only t))
698 da4022ab 2022-07-23 op (dolist (file files)
699 da4022ab 2022-07-23 op (vc-got--log (file-relative-name file worktree-path)
700 da4022ab 2022-07-23 op limit
701 da4022ab 2022-07-23 op start-revision)))))
702 eb85ad27 2020-12-05 op
703 9ad1eb5d 2020-12-07 op (defun vc-got-log-outgoing (buffer remote-location)
704 9ad1eb5d 2020-12-07 op "Fill BUFFER with the diff between the local worktree branch and REMOTE-LOCATION."
705 9ad1eb5d 2020-12-07 op (vc-setup-buffer buffer)
706 a1839dca 2021-08-17 op (let ((rl (vc-got-next-revision
707 a1839dca 2021-08-17 op nil
708 a1839dca 2021-08-17 op (if (or (not remote-location) (string-empty-p remote-location))
709 a1839dca 2021-08-17 op (concat "origin/" (vc-got--current-branch))
710 a1839dca 2021-08-17 op remote-location)))
711 9ad1eb5d 2020-12-07 op (inhibit-read-only t))
712 9ad1eb5d 2020-12-07 op (with-current-buffer buffer
713 9ad1eb5d 2020-12-07 op (vc-got--log nil nil nil rl))))
714 6eda2f1f 2020-12-26 op
715 3ec0e0ca 2022-07-19 op (defun vc-got-log-incoming (buffer remote-location)
716 3391eaf8 2022-02-01 op "Fill BUFFER with the incoming diff from REMOTE-LOCATION.
717 3391eaf8 2022-02-01 op That is, the diff between REMOTE-LOCATION and the local repository."
718 3ec0e0ca 2022-07-19 op (vc-setup-buffer buffer)
719 6eda2f1f 2020-12-26 op (let ((rl (if (or (not remote-location) (string-empty-p remote-location))
720 6eda2f1f 2020-12-26 op (concat "origin/" (vc-got--current-branch))
721 6eda2f1f 2020-12-26 op remote-location))
722 6eda2f1f 2020-12-26 op (inhibit-read-only t))
723 6eda2f1f 2020-12-26 op (with-current-buffer buffer
724 6eda2f1f 2020-12-26 op (vc-got--log nil nil (vc-got--current-branch) rl))))
725 9ad1eb5d 2020-12-07 op
726 eb85ad27 2020-12-05 op (defun vc-got-log-search (buffer pattern)
727 eb85ad27 2020-12-05 op "Search commits for PATTERN and write the results found in BUFFER."
728 eb85ad27 2020-12-05 op (with-current-buffer buffer
729 eb85ad27 2020-12-05 op (let ((inhibit-read-only t))
730 9ad1eb5d 2020-12-07 op (vc-got--log nil nil nil nil pattern))))
731 eb85ad27 2020-12-05 op
732 0a3316a6 2021-02-22 op (define-derived-mode vc-got-log-view-mode log-view-mode "Got-Log-View"
733 0a3316a6 2021-02-22 op "Got-specific log-view mode.
734 0a3316a6 2021-02-22 op Heavily inspired by `vc-git-log-view-mode'."
735 0a3316a6 2021-02-22 op (require 'add-log)
736 95a78ecb 2021-08-31 op (setq-local log-view-file-re regexp-unmatchable)
737 95a78ecb 2021-08-31 op (setq-local log-view-per-file-logs nil)
738 95a78ecb 2021-08-31 op (setq-local log-view-message-re "^commit +\\([0-9a-z]+\\)")
739 95a78ecb 2021-08-31 op (setq-local log-view-font-lock-keywords
740 95a78ecb 2021-08-31 op (append
741 95a78ecb 2021-08-31 op `((,log-view-message-re (1 'change-log-acknowledgment)))
742 95a78ecb 2021-08-31 op ;; Handle the case:
743 95a78ecb 2021-08-31 op ;; user: foo@bar
744 95a78ecb 2021-08-31 op '(("^from: \\([A-Za-z0-9_.+-]+@[A-Za-z0-9_.-]+\\)"
745 95a78ecb 2021-08-31 op (1 'change-log-email))
746 95a78ecb 2021-08-31 op ;; Handle the case:
747 95a78ecb 2021-08-31 op ;; user: FirstName LastName <foo@bar>
748 95a78ecb 2021-08-31 op ("^from: \\([^<(]+?\\)[ \t]*[(<]\\([A-Za-z0-9_.+-]+@[A-Za-z0-9_.-]+\\)[>)]"
749 95a78ecb 2021-08-31 op (1 'change-log-name)
750 95a78ecb 2021-08-31 op (2 'change-log-email))
751 95a78ecb 2021-08-31 op ("^date: \\(.+\\)" (1 'change-log-date))))))
752 0a3316a6 2021-02-22 op
753 eb85ad27 2020-12-05 op ;; TODO: async
754 f18d3e11 2020-12-05 op ;; TODO: return 0 or 1
755 eb85ad27 2020-12-05 op (defun vc-got-diff (files &optional rev1 rev2 buffer _async)
756 eb85ad27 2020-12-05 op "Insert into BUFFER (or *vc-diff*) the diff for FILES from REV1 to REV2."
757 f457868b 2020-12-07 op (let* ((buffer (get-buffer-create (or buffer "*vc-diff*")))
758 eb85ad27 2020-12-05 op (inhibit-read-only t))
759 eb85ad27 2020-12-05 op (with-current-buffer buffer
760 8ec0bb76 2021-08-11 op (vc-got-with-worktree (or (car files)
761 8ec0bb76 2021-08-11 op default-directory)
762 32819756 2021-09-14 op (cond ((and (null rev1)
763 32819756 2021-09-14 op (null rev2))
764 45f7f941 2021-11-09 op (vc-got--diff-files files))
765 32819756 2021-09-14 op ((and (null rev1)
766 32819756 2021-09-14 op rev2)
767 32819756 2021-09-14 op ;; TODO: this includes the whole diff while to respect
768 32819756 2021-09-14 op ;; the vc semantics we should filter only the diff for
769 32819756 2021-09-14 op ;; files in FILES.
770 32819756 2021-09-14 op ;;
771 32819756 2021-09-14 op ;; XXX: this includes also the commit message, I
772 32819756 2021-09-14 op ;; consider it a feature over the usual vc behaviour of
773 32819756 2021-09-14 op ;; showing only the diff.
774 32819756 2021-09-14 op (vc-got--log nil 1 rev2 nil nil nil t))
775 32819756 2021-09-14 op ;;
776 32819756 2021-09-14 op ;; TODO: if rev1 is nil, diff from the current version until
777 32819756 2021-09-14 op ;; rev2.
778 32819756 2021-09-14 op ;;
779 32819756 2021-09-14 op ;; TODO 2: if rev2 is nil as well, diff against an empty
780 32819756 2021-09-14 op ;; tree (i.e. get the patch from `got log -p rev1')
781 36e5655f 2021-11-09 op (t (vc-got--diff-objects rev1 rev2)))))))
782 5fb2f474 2021-08-10 op
783 5fb2f474 2021-08-10 op (defun vc-got-revision-completion-table (_files)
784 5fb2f474 2021-08-10 op "Return a completion table for existing revisions.
785 5fb2f474 2021-08-10 op Ignores FILES because GoT doesn't have the concept of ``file
786 5fb2f474 2021-08-10 op revisions''; instead, like with git, you have tags and branches."
787 5fb2f474 2021-08-10 op (letrec ((table (lazy-completion-table
788 5fb2f474 2021-08-10 op table (lambda () (vc-got--ref)))))
789 5fb2f474 2021-08-10 op table))
790 3f25d9ff 2020-01-02 noreply
791 3f25d9ff 2020-01-02 noreply (defun vc-got-annotate-command (file buf &optional rev)
792 67332bad 2021-01-05 op "Show annotated contents of FILE in buffer BUF. If given, use revision REV."
793 3f25d9ff 2020-01-02 noreply (let (process-file-side-effects)
794 3f25d9ff 2020-01-02 noreply (with-current-buffer buf
795 3f25d9ff 2020-01-02 noreply ;; FIXME: vc-ensure-vc-buffer won't recognise this buffer as managed
796 3f25d9ff 2020-01-02 noreply ;; by got unless vc-parent-buffer points to a buffer managed by got.
797 3f25d9ff 2020-01-02 noreply ;; investigate why this is needed.
798 3efc7598 2021-09-09 op (setq-local vc-parent-buffer (find-file-noselect file))
799 76d978fa 2021-01-05 op (vc-got--call "blame"
800 76d978fa 2021-01-05 op (when rev (list "-c" rev))
801 c3185bf7 2021-08-11 op "--"
802 76d978fa 2021-01-05 op file))))
803 3f25d9ff 2020-01-02 noreply
804 3f25d9ff 2020-01-02 noreply (defconst vc-got--annotate-re
805 3f25d9ff 2020-01-02 noreply (concat "^[0-9]\\{1,\\}) " ; line number followed by )
806 3f25d9ff 2020-01-02 noreply "\\([a-z0-9]+\\) " ; SHA-1 of commit
807 3f25d9ff 2020-01-02 noreply "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\) " ; year-mm-dd
808 3f25d9ff 2020-01-02 noreply "\\([^ ]\\)+ ") ; author
809 3f25d9ff 2020-01-02 noreply "Regexp to match annotation output lines.
810 3f25d9ff 2020-01-02 noreply Provides capture groups for:
811 3f25d9ff 2020-01-02 noreply 1. revision id
812 3f25d9ff 2020-01-02 noreply 2. date of commit
813 3f25d9ff 2020-01-02 noreply 3. author of commit")
814 3f25d9ff 2020-01-02 noreply
815 3f25d9ff 2020-01-02 noreply (defconst vc-got--commit-re "^commit \\([a-z0-9]+\\)"
816 3f25d9ff 2020-01-02 noreply "Regexp to match commit lines.
817 3f25d9ff 2020-01-02 noreply Provides capture group for the commit revision id.")
818 3f25d9ff 2020-01-02 noreply
819 3f25d9ff 2020-01-02 noreply (defun vc-got-annotate-time ()
820 3f25d9ff 2020-01-02 noreply "Return the time of the next line of annotation at or after point.
821 3f25d9ff 2020-01-02 noreply Value is returned as floating point fractional number of days."
822 01c0cd8c 2021-09-14 op ;; XXX: to behave like vc-git here we should call re-search-forward
823 01c0cd8c 2021-09-14 op ;; instead of looking-at, as it makes the fontification of the line
824 01c0cd8c 2021-09-14 op ;; start AFTER the info. The problem is, due to the format of the
825 01c0cd8c 2021-09-14 op ;; blame, it produces an ugly result, with colors starting at
826 0a5a024b 2022-02-01 op ;; different offsets depending on how long the committer name is.
827 01c0cd8c 2021-09-14 op (when (looking-at vc-got--annotate-re)
828 01c0cd8c 2021-09-14 op (let ((str (match-string-no-properties 2)))
829 01c0cd8c 2021-09-14 op (vc-annotate-convert-time
830 01c0cd8c 2021-09-14 op (encode-time 0 0 0
831 01c0cd8c 2021-09-14 op (string-to-number (substring str 8 10))
832 01c0cd8c 2021-09-14 op (string-to-number (substring str 5 7))
833 01c0cd8c 2021-09-14 op (string-to-number (substring str 0 4)))))))
834 eb85ad27 2020-12-05 op
835 3f25d9ff 2020-01-02 noreply (defun vc-got-annotate-extract-revision-at-line ()
836 67332bad 2021-01-05 op "Return revision corresponding to the current line or nil."
837 3f25d9ff 2020-01-02 noreply (save-excursion
838 3f25d9ff 2020-01-02 noreply (beginning-of-line)
839 3f25d9ff 2020-01-02 noreply (when (looking-at vc-got--annotate-re)
840 3f25d9ff 2020-01-02 noreply (match-string-no-properties 1))))
841 3f25d9ff 2020-01-02 noreply
842 424f5152 2021-08-10 op
843 8014bde1 2021-08-10 op ;; Tag system
844 6ab1c7b4 2021-08-11 op
845 6ab1c7b4 2021-08-11 op (defun vc-got--tag-callback (tag)
846 6ab1c7b4 2021-08-11 op "`log-edit' callback for `vc-got-create-tag'.
847 6ab1c7b4 2021-08-11 op Creates the TAG using the content of the current buffer."
848 6ab1c7b4 2021-08-11 op (interactive)
849 6ab1c7b4 2021-08-11 op (let ((msg (buffer-substring-no-properties (point-min)
850 6ab1c7b4 2021-08-11 op (point-max))))
851 6ab1c7b4 2021-08-11 op (with-temp-buffer
852 3dcaa71b 2021-08-31 op (unless (zerop (vc-got--call "tag"
853 3dcaa71b 2021-08-31 op "-m"
854 3dcaa71b 2021-08-31 op (log-edit-extract-headers nil msg)
855 3dcaa71b 2021-08-31 op "--"
856 3dcaa71b 2021-08-31 op tag))
857 6ab1c7b4 2021-08-11 op (error "[vc-got] can't create tag %s: %s" tag (buffer-string))))))
858 8014bde1 2021-08-10 op
859 8014bde1 2021-08-10 op (defun vc-got-create-tag (_dir name branchp)
860 8014bde1 2021-08-10 op "Attach the tag NAME to the state of the worktree.
861 6ab1c7b4 2021-08-11 op DIR is ignored (tags are global, not per-file). If BRANCHP is
862 6ab1c7b4 2021-08-11 op true, NAME should create a new branch otherwise it will pop-up a
863 6ab1c7b4 2021-08-11 op `log-edit' buffer to provide the tag message."
864 8014bde1 2021-08-10 op ;; TODO: vc reccomends to ensure that all the file are in a clean
865 8014bde1 2021-08-10 op ;; state, but is it useful?
866 8014bde1 2021-08-10 op (if branchp
867 8014bde1 2021-08-10 op (vc-got--branch name)
868 6ab1c7b4 2021-08-11 op (let ((buf (get-buffer-create "*vc-got tag*")))
869 6ab1c7b4 2021-08-11 op (with-current-buffer buf
870 6ab1c7b4 2021-08-11 op (erase-buffer)
871 3dcaa71b 2021-08-31 op (save-excursion
872 3dcaa71b 2021-08-31 op (insert "Summary: tag " name "\n\n"))
873 3dcaa71b 2021-08-31 op (move-end-of-line 1)
874 6ab1c7b4 2021-08-11 op (switch-to-buffer buf)
875 6ab1c7b4 2021-08-11 op (log-edit (lambda ()
876 6ab1c7b4 2021-08-11 op (interactive)
877 6ab1c7b4 2021-08-11 op (unwind-protect
878 6ab1c7b4 2021-08-11 op (vc-got--tag-callback name)
879 6ab1c7b4 2021-08-11 op (kill-buffer buf))))))))
880 8014bde1 2021-08-10 op
881 09d59379 2021-08-11 op (defun vc-got-retrieve-tag (dir name _update)
882 09d59379 2021-08-11 op "Switch to the tag NAME for files at or below DIR."
883 09d59379 2021-08-11 op (let ((default-directory dir))
884 db89d6fd 2021-08-16 op (vc-got--update name dir)))
885 09d59379 2021-08-11 op
886 8014bde1 2021-08-10 op
887 424f5152 2021-08-10 op ;; Miscellaneous
888 424f5152 2021-08-10 op
889 2552a6c7 2021-08-11 op (defun vc-got-find-ignore-file (file)
890 2552a6c7 2021-08-11 op "Return the gitignore file that controls FILE."
891 2552a6c7 2021-08-11 op (expand-file-name ".gitignore"
892 2552a6c7 2021-08-11 op (vc-got-root file)))
893 2552a6c7 2021-08-11 op
894 3f25d9ff 2020-01-02 noreply (defun vc-got-previous-revision (file rev)
895 3ec8a8b4 2021-08-17 op "Return the revision number that precedes REV for FILE or nil."
896 3f25d9ff 2020-01-02 noreply (with-temp-buffer
897 3f25d9ff 2020-01-02 noreply (vc-got--log file 2 rev nil nil t)
898 3f25d9ff 2020-01-02 noreply (goto-char (point-min))
899 3f25d9ff 2020-01-02 noreply (keep-lines "^commit")
900 3f25d9ff 2020-01-02 noreply (when (looking-at vc-got--commit-re)
901 3f25d9ff 2020-01-02 noreply (match-string-no-properties 1))))
902 3f25d9ff 2020-01-02 noreply
903 3f25d9ff 2020-01-02 noreply (defun vc-got-next-revision (file rev)
904 3ec8a8b4 2021-08-17 op "Return the revision number that follows REV for FILE or nil."
905 3f25d9ff 2020-01-02 noreply (with-temp-buffer
906 3f25d9ff 2020-01-02 noreply (vc-got--log file nil nil rev)
907 3f25d9ff 2020-01-02 noreply (keep-lines "^commit" (point-min) (point-max))
908 3f25d9ff 2020-01-02 noreply (goto-char (point-max))
909 76d978fa 2021-01-05 op (forward-line -1) ; return from empty line to last actual commit
910 3f25d9ff 2020-01-02 noreply (unless (= (point) (point-min))
911 3f25d9ff 2020-01-02 noreply (forward-line -1)
912 3f25d9ff 2020-01-02 noreply (when (looking-at vc-got--commit-re)
913 3f25d9ff 2020-01-02 noreply (match-string-no-properties 1)))))
914 3f25d9ff 2020-01-02 noreply
915 a96df0e8 2020-01-03 noreply (defun vc-got-delete-file (file)
916 a96df0e8 2020-01-03 noreply "Delete FILE locally and mark it deleted in work tree."
917 a96df0e8 2020-01-03 noreply (vc-got--remove file t))
918 a96df0e8 2020-01-03 noreply
919 c151c257 2021-08-03 op (defun vc-got-find-file-hook ()
920 c151c257 2021-08-03 op "Activate `smerge-mode' if there is a conflict."
921 c151c257 2021-08-03 op ;; just like vc-git-find-file-hook
922 c151c257 2021-08-03 op (when (and buffer-file-name
923 c151c257 2021-08-03 op (eq (vc-state buffer-file-name 'Got) 'conflict)
924 c151c257 2021-08-03 op (save-excursion
925 c151c257 2021-08-03 op (goto-char (point-min))
926 c151c257 2021-08-03 op (re-search-forward "^<<<<<<< " nil 'noerror)))
927 c151c257 2021-08-03 op (smerge-start-session)
928 c151c257 2021-08-03 op (vc-message-unresolved-conflicts buffer-file-name)))
929 c151c257 2021-08-03 op
930 7bb16f79 2020-01-03 op (defun vc-got-conflicted-files (dir)
931 7bb16f79 2020-01-03 op "Return the list of files with conflicts in directory DIR."
932 7bb16f79 2020-01-03 op (let* ((root (vc-got-root dir))
933 7bb16f79 2020-01-03 op (default-directory root)
934 3efc7598 2021-09-09 op (process-file-side-effects nil))
935 3efc7598 2021-09-09 op (cl-loop for (file status _) in (vc-got--status "C" ".")
936 3efc7598 2021-09-09 op when (and (eq status 'conflict)
937 3efc7598 2021-09-09 op (file-in-directory-p file dir))
938 3efc7598 2021-09-09 op collect file)))
939 7bb16f79 2020-01-03 op
940 8b635a9f 2020-01-03 op (defun vc-got-repository-url (_file &optional remote-name)
941 8b635a9f 2020-01-03 op "Return URL for REMOTE-NAME, or for \"origin\" if nil."
942 8b635a9f 2020-01-03 op (let* ((default-directory (vc-got--repo-root))
943 8b635a9f 2020-01-03 op (remote-name (or remote-name "origin"))
944 8b635a9f 2020-01-03 op (heading (concat "[remote \"" remote-name "\"]"))
945 76d978fa 2021-01-05 op (conf (cond ((file-exists-p ".git/config") ".git/config")
946 76d978fa 2021-01-05 op ((file-exists-p ".git") nil)
947 76d978fa 2021-01-05 op ((file-exists-p "config") "config")))
948 8b635a9f 2020-01-03 op found)
949 6f42ede4 2021-01-05 op (when conf
950 6f42ede4 2021-01-05 op (with-temp-buffer
951 f8a9db56 2020-01-03 op (insert-file-contents conf)
952 f8a9db56 2020-01-03 op (goto-char (point-min))
953 f8a9db56 2020-01-03 op (when (search-forward heading nil t)
954 f8a9db56 2020-01-03 op (forward-line)
955 f8a9db56 2020-01-03 op (while (and (not found)
956 76d978fa 2021-01-05 op (looking-at ".*=") ; too broad?
957 7a5ead65 2020-01-03 op (not (= (point) (point-max))))
958 f8a9db56 2020-01-03 op (when (looking-at ".*url = \\(.*\\)")
959 7a5ead65 2020-01-03 op (setq found (match-string-no-properties 1)))
960 7a5ead65 2020-01-03 op (forward-line))
961 f8a9db56 2020-01-03 op found)))))
962 a1679b13 2021-09-09 op
963 a1679b13 2021-09-09 op
964 8b635a9f 2020-01-03 op
965 a1679b13 2021-09-09 op ;; Automatically register the backend and add ".got" to the exclusion
966 a1679b13 2021-09-09 op ;; list.
967 a1679b13 2021-09-09 op
968 a1679b13 2021-09-09 op ;;;###autoload
969 a1679b13 2021-09-09 op (add-to-list 'vc-handled-backends 'Got)
970 a1679b13 2021-09-09 op
971 a1679b13 2021-09-09 op ;;;###autoload
972 a1679b13 2021-09-09 op (add-to-list 'vc-directory-exclusion-list ".got")
973 a1679b13 2021-09-09 op
974 af5ef7cd 2020-11-29 op (provide 'vc-got)
975 af5ef7cd 2020-11-29 op ;;; vc-got.el ends here