aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2018-06-28 03:05:19 +0300
committerDmitry Gutov2018-06-28 03:05:19 +0300
commit7ea0873b4f0ceb1ed11c4ab3d692405efc6c79cf (patch)
tree12790e1dfa86345e81191919b9d9a7d766741872
parent4a7f4232ed415e042a72b85d9c4de1f421ce2bce (diff)
downloademacs-7ea0873b4f0ceb1ed11c4ab3d692405efc6c79cf.tar.gz
emacs-7ea0873b4f0ceb1ed11c4ab3d692405efc6c79cf.zip
; Update some commentary
* lisp/vc/vc-git.el (vc-git-state): Remove outdated commentary. (vc-git-dir-status-goto-stage): Move a TODO here. (vc-git-conflicted-files): From here. (vc-git-find-file-hook): Add a FIXME.
-rw-r--r--lisp/vc/vc-git.el10
1 files changed, 3 insertions, 7 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 11b9b34ff69..56e85378cb3 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -298,9 +298,6 @@ in the order given by 'git status'."
298 '("--ignored")) 298 '("--ignored"))
299 "--")) 299 "--"))
300 (status (apply #'vc-git--run-command-string file args))) 300 (status (apply #'vc-git--run-command-string file args)))
301 ;; Alternatively, the `ignored' state could be detected with 'git
302 ;; ls-files -i -o --exclude-standard', but that's an extra process
303 ;; call, and the `ignored' state is rarely needed.
304 (if (null status) 301 (if (null status)
305 ;; If status is nil, there was an error calling git, likely because 302 ;; If status is nil, there was an error calling git, likely because
306 ;; the file is not in a git repo. 303 ;; the file is not in a git repo.
@@ -565,6 +562,7 @@ or an empty string if none."
565(declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) 562(declare-function vc-set-async-update "vc-dispatcher" (process-buffer))
566 563
567(defun vc-git-dir-status-goto-stage (git-state) 564(defun vc-git-dir-status-goto-stage (git-state)
565 ;; TODO: Look into reimplementing this using `git status --porcelain=v2'.
568 (let ((files (vc-git-dir-status-state->files git-state))) 566 (let ((files (vc-git-dir-status-state->files git-state)))
569 (erase-buffer) 567 (erase-buffer)
570 (pcase (vc-git-dir-status-state->stage git-state) 568 (pcase (vc-git-dir-status-state->stage git-state)
@@ -942,9 +940,6 @@ This prompts for a branch to merge from."
942 (vc-git--run-command-string directory "status" "--porcelain" "--")) 940 (vc-git--run-command-string directory "status" "--porcelain" "--"))
943 (lines (when status (split-string status "\n" 'omit-nulls))) 941 (lines (when status (split-string status "\n" 'omit-nulls)))
944 files) 942 files)
945 ;; TODO: Look into reimplementing `vc-git-state', as well as
946 ;; `vc-git-dir-status-files', based on this output, thus making the
947 ;; extra process call in `vc-git-find-file-hook' unnecessary.
948 (dolist (line lines files) 943 (dolist (line lines files)
949 (when (string-match "\\([ MADRCU?!][ MADRCU?!]\\) \\(.+\\)\\(?: -> \\(.+\\)\\)?" 944 (when (string-match "\\([ MADRCU?!][ MADRCU?!]\\) \\(.+\\)\\(?: -> \\(.+\\)\\)?"
950 line) 945 line)
@@ -979,10 +974,11 @@ This prompts for a branch to merge from."
979(defun vc-git-find-file-hook () 974(defun vc-git-find-file-hook ()
980 "Activate `smerge-mode' if there is a conflict." 975 "Activate `smerge-mode' if there is a conflict."
981 (when (and buffer-file-name 976 (when (and buffer-file-name
982 ;; FIXME 977 ;; FIXME:
983 ;; 1) the net result is to call git twice per file. 978 ;; 1) the net result is to call git twice per file.
984 ;; 2) v-g-c-f is documented to take a directory. 979 ;; 2) v-g-c-f is documented to take a directory.
985 ;; https://lists.gnu.org/r/emacs-devel/2014-01/msg01126.html 980 ;; https://lists.gnu.org/r/emacs-devel/2014-01/msg01126.html
981 ;; FIXME: vc-git-state can return `conflict' now.
986 (vc-git-conflicted-files buffer-file-name) 982 (vc-git-conflicted-files buffer-file-name)
987 (save-excursion 983 (save-excursion
988 (goto-char (point-min)) 984 (goto-char (point-min))