git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 5/7] Try to do things in the right order

From
XMXavier Maillard <zedek@gnu.org>
Date
Mar 3, 2007, 10:19 UTC
Message-ID
<15303.1172917192@localhost>
* emacs/vc-git.el: Added an ugly hack to properly reload vc-git. Only
  add GIT to vc-backends list after loading vc. Do not walk .git
  directory (add it to the exclusion-list).
  Changed installation instructions as discussed on Git mailing list
Signed-off-by: Xavier Maillard <zedek@gnu.org>
---
 contrib/emacs/vc-git.el |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/contrib/emacs/vc-git.el b/contrib/emacs/vc-git.el
index 748cb60..3f37e6d 100644
--- a/contrib/emacs/vc-git.el
+++ b/contrib/emacs/vc-git.el
@@ -22,7 +22,8 @@
 ;; This file contains a VC backend for the git version control
 ;; system.
 ;;
-;; To install: put this file on the load-path.
+;; To install: put this file on the load-path then add this line into
+;;   your .emacs: (require 'vc-git)
 ;;
 ;; TODO
 ;;  - changelog generation
@@ -35,8 +36,14 @@
   (require 'vc)
   (require 'cl))
 
-;; Add it automatically
-(add-to-list 'vc-handled-backends 'GIT)
+;; HACK: clear up the cache to force vc-call to check again and
+;; discover new functions when we reload this file.
+(put 'GIT 'vc-functions nil)
+
+;; Add it automatically when loading vc
+;; FIXME: should be directly put into vc.el
+(eval-after-load "vc"
+  '(add-to-list 'vc-handled-backends 'GIT))
 
 (defgroup vc-git nil
   "*This is GIT backend for vc."
@@ -188,4 +195,8 @@ COMMENT is the new comment."
 ;;;###autoload
 (add-to-list 'completion-ignored-extensions ".git/")
 
+(eval-after-load "vc" 
+    '(add-to-list 'vc-directory-exclusion-list ".git" t))
+
 (provide 'vc-git)
+;;; vc-git.el ends here
\ No newline at end of file
-- 
1.5.0
Next: Alexandre Julliard
Message 1 of 3 in “Try to do things in the right order”
  1. 5/7 Try to do things in the right orderXavier Maillard, Mar 3, 2007
  2. Alexandre JulliardMar 3, 2007
  3. Xavier MaillardMar 5, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.