Skip to contentSkip to conversation

Automatically add GIT as a VC backend

PATCH In review Xavier Maillard 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Automatically add GIT as a VC backend

Hi,

A small patch with following changes:

Automatically add GIT as a VC backend

Remove byte-compiler warning with an eval of vc

---
 contrib/emacs/vc-git.el |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
contrib/emacs/vc-git.el +7 -6
index e456ab9..a2d3932 100644
@@ -22,18 +22,19 @@
 ;; This file contains a VC backend for the git version control
 ;; system.
 ;;
-;; To install: put this file on the load-path and add GIT to the list
-;; of supported backends in `vc-handled-backends'; the following line,
-;; placed in your ~/.emacs, will accomplish this:
-;;
-;;     (add-to-list 'vc-handled-backends 'GIT)
+;; To install: put this file on the load-path.
 ;;
 ;; TODO
 ;;  - changelog generation
 ;;  - working with revisions other than HEAD
 ;;
 
-(eval-when-compile (require 'cl))
+(eval-when-compile 
+  (require 'cl)
+  (require 'vc))
+
+;; Add it automatically
+(add-to-list 'vc-handled-backends 'GIT)
 
 (defvar git-commits-coding-system 'utf-8
   "Default coding system for git commits.")
Signature · 1 line
Xavier
#1 lore raw

contrib/emacs/vc-git.el line 25

Quoted 10 lines · Xavier Maillard
contrib/emacs/vc-git.el +1 -5
@@ -22,18 +22,19 @@
 ;; This file contains a VC backend for the git version control
 ;; system.
 ;;
-;; To install: put this file on the load-path and add GIT to the list
-;; of supported backends in `vc-handled-backends'; the following line,
-;; placed in your ~/.emacs, will accomplish this:
-;;
-;;     (add-to-list 'vc-handled-backends 'GIT)
+;; To install: put this file on the load-path.

Simply putting it on the load-path is not enough to make it work, you'd still have to load it explicitly; it's not clear to me that this is better than adding it to vc-handled-backends. We can of course support both approaches, so the rest of your patch is fine, I just don't think the installation instructions should be changed.

Signature · 2 lines
Alexandre Julliard
[email protected]
#2 lore raw
Quoted 16 lines · Alexandre Julliard

contrib/emacs/vc-git.el line 25

Quoted 10 lines · Xavier Maillard
contrib/emacs/vc-git.el +1 -5
@@ -22,18 +22,19 @@
 ;; This file contains a VC backend for the git version control
 ;; system.
 ;;
-;; To install: put this file on the load-path and add GIT to the list
-;; of supported backends in `vc-handled-backends'; the following line,
-;; placed in your ~/.emacs, will accomplish this:
-;;
-;;     (add-to-list 'vc-handled-backends 'GIT)
+;; To install: put this file on the load-path.

Simply putting it on the load-path is not enough to make it work, you'd still have to load it explicitly; it's not clear to me that this is better than adding it to vc-handled-backends.

You are right.

Xavier