aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2009-08-26 06:48:58 +0000
committerDan Nicolaescu2009-08-26 06:48:58 +0000
commitb91f07620f3a6fb4041b82c867de3b1d6138d9a4 (patch)
tree56782a61ff4276fea40e3f035556782b7b8b9d93
parentb8e5436265d002cbcc66e1d84712a0a471058be6 (diff)
downloademacs-b91f07620f3a6fb4041b82c867de3b1d6138d9a4.tar.gz
emacs-b91f07620f3a6fb4041b82c867de3b1d6138d9a4.zip
(vc-git-register): Use "git add" for directories.
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/vc-git.el104
2 files changed, 58 insertions, 48 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 382463d9bce..ed131c8f34e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
12009-08-26 Dan Nicolaescu <dann@ics.uci.edu> 12009-08-26 Dan Nicolaescu <dann@ics.uci.edu>
2 2
3 * vc-git.el (vc-git-register): Use "git add" for directories.
4
3 * vc-dir.el (vc-dir-node-directory, vc-dir-update): Get the parent 5 * vc-dir.el (vc-dir-node-directory, vc-dir-update): Get the parent
4 directory correctly in case the item is a directory itself. 6 directory correctly in case the item is a directory itself.
5 7
diff --git a/lisp/vc-git.el b/lisp/vc-git.el
index 923ea63acf8..1d7da4b5c4a 100644
--- a/lisp/vc-git.el
+++ b/lisp/vc-git.el
@@ -43,64 +43,64 @@
43;; beginning of vc.el. The current status is: 43;; beginning of vc.el. The current status is:
44;; ("??" means: "figure out what to do about it") 44;; ("??" means: "figure out what to do about it")
45;; 45;;
46;; FUNCTION NAME STATUS 46;; FUNCTION NAME STATUS
47;; BACKEND PROPERTIES 47;; BACKEND PROPERTIES
48;; * revision-granularity OK 48;; * revision-granularity OK
49;; STATE-QUERYING FUNCTIONS 49;; STATE-QUERYING FUNCTIONS
50;; * registered (file) OK 50;; * registered (file) OK
51;; * state (file) OK 51;; * state (file) OK
52;; - state-heuristic (file) NOT NEEDED 52;; - state-heuristic (file) NOT NEEDED
53;; * working-revision (file) OK 53;; * working-revision (file) OK
54;; - latest-on-branch-p (file) NOT NEEDED 54;; - latest-on-branch-p (file) NOT NEEDED
55;; * checkout-model (files) OK 55;; * checkout-model (files) OK
56;; - workfile-unchanged-p (file) OK 56;; - workfile-unchanged-p (file) OK
57;; - mode-line-string (file) OK 57;; - mode-line-string (file) OK
58;; STATE-CHANGING FUNCTIONS 58;; STATE-CHANGING FUNCTIONS
59;; * create-repo () OK 59;; * create-repo () OK
60;; * register (files &optional rev comment) OK 60;; * register (files &optional rev comment) OK
61;; - init-revision (file) NOT NEEDED 61;; - init-revision (file) NOT NEEDED
62;; - responsible-p (file) OK 62;; - responsible-p (file) OK
63;; - could-register (file) NOT NEEDED, DEFAULT IS GOOD 63;; - could-register (file) NOT NEEDED, DEFAULT IS GOOD
64;; - receive-file (file rev) NOT NEEDED 64;; - receive-file (file rev) NOT NEEDED
65;; - unregister (file) OK 65;; - unregister (file) OK
66;; * checkin (files rev comment) OK 66;; * checkin (files rev comment) OK
67;; * find-revision (file rev buffer) OK 67;; * find-revision (file rev buffer) OK
68;; * checkout (file &optional editable rev) OK 68;; * checkout (file &optional editable rev) OK
69;; * revert (file &optional contents-done) OK 69;; * revert (file &optional contents-done) OK
70;; - rollback (files) COULD BE SUPPORTED 70;; - rollback (files) COULD BE SUPPORTED
71;; - merge (file rev1 rev2) It would be possible to merge 71;; - merge (file rev1 rev2) It would be possible to merge
72;; changes into a single file, but when 72;; changes into a single file, but when
73;; committing they wouldn't 73;; committing they wouldn't
74;; be identified as a merge 74;; be identified as a merge
75;; by git, so it's probably 75;; by git, so it's probably
76;; not a good idea. 76;; not a good idea.
77;; - merge-news (file) see `merge' 77;; - merge-news (file) see `merge'
78;; - steal-lock (file &optional revision) NOT NEEDED 78;; - steal-lock (file &optional revision) NOT NEEDED
79;; HISTORY FUNCTIONS 79;; HISTORY FUNCTIONS
80;; * print-log (files &optional buffer) OK 80;; * print-log (files &optional buffer shortlog) OK
81;; - log-view-mode () OK 81;; - log-view-mode () OK
82;; - show-log-entry (revision) OK 82;; - show-log-entry (revision) OK
83;; - comment-history (file) ?? 83;; - comment-history (file) ??
84;; - update-changelog (files) COULD BE SUPPORTED 84;; - update-changelog (files) COULD BE SUPPORTED
85;; * diff (file &optional rev1 rev2 buffer) OK 85;; * diff (file &optional rev1 rev2 buffer) OK
86;; - revision-completion-table (files) OK 86;; - revision-completion-table (files) OK
87;; - annotate-command (file buf &optional rev) OK 87;; - annotate-command (file buf &optional rev) OK
88;; - annotate-time () OK 88;; - annotate-time () OK
89;; - annotate-current-time () NOT NEEDED 89;; - annotate-current-time () NOT NEEDED
90;; - annotate-extract-revision-at-line () OK 90;; - annotate-extract-revision-at-line () OK
91;; TAG SYSTEM 91;; TAG SYSTEM
92;; - create-tag (dir name branchp) OK 92;; - create-tag (dir name branchp) OK
93;; - retrieve-tag (dir name update) OK, needs to update buffers 93;; - retrieve-tag (dir name update) OK
94;; MISCELLANEOUS 94;; MISCELLANEOUS
95;; - make-version-backups-p (file) NOT NEEDED 95;; - make-version-backups-p (file) NOT NEEDED
96;; - repository-hostname (dirname) NOT NEEDED 96;; - repository-hostname (dirname) NOT NEEDED
97;; - previous-revision (file rev) OK 97;; - previous-revision (file rev) OK
98;; - next-revision (file rev) OK 98;; - next-revision (file rev) OK
99;; - check-headers () COULD BE SUPPORTED 99;; - check-headers () COULD BE SUPPORTED
100;; - clear-headers () NOT NEEDED 100;; - clear-headers () NOT NEEDED
101;; - delete-file (file) OK 101;; - delete-file (file) OK
102;; - rename-file (old new) OK 102;; - rename-file (old new) OK
103;; - find-file-hook () NOT NEEDED 103;; - find-file-hook () NOT NEEDED
104 104
105(eval-when-compile 105(eval-when-compile
106 (require 'cl) 106 (require 'cl)
@@ -426,8 +426,16 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
426 (vc-git-command nil 0 nil "init")) 426 (vc-git-command nil 0 nil "init"))
427 427
428(defun vc-git-register (files &optional rev comment) 428(defun vc-git-register (files &optional rev comment)
429 "Register FILE into the git version-control system." 429 "Register FILES into the git version-control system."
430 (vc-git-command nil 0 files "update-index" "--add" "--")) 430 (let (flist dlist)
431 (dolist (crt files)
432 (if (file-directory-p crt)
433 (push crt dlist)
434 (push crt flist)))
435 (when flist
436 (vc-git-command nil 0 flist "update-index" "--add" "--"))
437 (when dlist
438 (vc-git-command nil 0 dlist "add"))))
431 439
432(defalias 'vc-git-responsible-p 'vc-git-root) 440(defalias 'vc-git-responsible-p 'vc-git-root)
433 441