[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 0c76f94: vc-git-state: Bring back CentOS 6 compatib
From: |
Dmitry Gutov |
Subject: |
[Emacs-diffs] master 0c76f94: vc-git-state: Bring back CentOS 6 compatibility |
Date: |
Mon, 1 May 2017 10:59:27 -0400 (EDT) |
branch: master
commit 0c76f946934891678382bebe979f28a48acc2116
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
vc-git-state: Bring back CentOS 6 compatibility
* lisp/vc/vc-git.el (vc-git-state):
Bring back CentOS 6 compatibility (bug#19343).
---
lisp/vc/vc-git.el | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 3761dd0..0e1c08c 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -268,9 +268,28 @@ in the order given by 'git status'."
(defun vc-git-state (file)
"Git-specific version of `vc-state'."
+ ;; FIXME: Still can't detect `ignored', see below, and returns
+ ;; `up-to-date' instead. Which is rarely a problem because
+ ;; `vc-backend' returns nil for ignored files.
+ ;;
+ ;; It also can't set `needs-update' or `needs-merge'. The rough
+ ;; equivalent would be that upstream branch for current branch is in
+ ;; fast-forward state i.e. current branch is direct ancestor of
+ ;; corresponding upstream branch, and the file was modified
+ ;; upstream. We'd need to check against the upstream tracking
+ ;; branch for that (an extra process call or two).
(let ((status
(vc-git--run-command-string file "status" "--porcelain" "-z"
- "--untracked-files" "--ignored" "--")))
+ ;; Just to be explicit, it's the
+ ;; default anyway.
+ "--untracked-files"
+ ;; Requires Git 1.7.6.3 or so,
+ ;; so does not work in CentOS 6
+ ;; "--ignored"
+ "--")))
+ ;; Alternatively, the `ignored' state could be detected with 'git
+ ;; ls-files -i -o --exclude-standard', but that's an extra process
+ ;; call, and the `ignored' state is rarely needed.
(if (null status)
;; If status is nil, there was an error calling git, likely because
;; the file is not in a git repo.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 0c76f94: vc-git-state: Bring back CentOS 6 compatibility,
Dmitry Gutov <=