path: root/contrib/emacs
diff options
authorAlexandre Julliard <>2008-08-04 07:30:42 (GMT)
committerAlexandre Julliard <>2008-11-23 10:54:38 (GMT)
commitb0a53e9e56d0a501aebc99d3614be413e91613f6 (patch)
tree0457ba8809e7fdbc71647dca65013a656a30a329 /contrib/emacs
parent433ee03f9748a8a5d0e0495bbf4b054ae922103b (diff)
git.el: Add an insert file command.
This allows to insert a file in the buffer no matter what its state is, making it possible for instance to remove an up-to-date file. Signed-off-by: Alexandre Julliard <>
Diffstat (limited to 'contrib/emacs')
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 67c5275..6119c31 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -1019,6 +1019,11 @@ Return the list of files that haven't been handled."
(setq node (ewoc-prev git-status node)))
(ewoc-goto-node git-status last)))
+(defun git-insert-file (file)
+ "Insert file(s) into the git-status buffer."
+ (interactive "fInsert file: ")
+ (git-update-status-files (list (file-relative-name file))))
(defun git-add-file ()
"Add marked file(s) to the index cache."
@@ -1449,6 +1454,7 @@ amended version of it."
(define-key map "\r" 'git-find-file)
(define-key map "g" 'git-refresh-status)
(define-key map "i" 'git-ignore-file)
+ (define-key map "I" 'git-insert-file)
(define-key map "l" 'git-log-file)
(define-key map "m" 'git-mark-file)
(define-key map "M" 'git-mark-all)
@@ -1505,6 +1511,7 @@ amended version of it."
["Revert File" git-revert-file t]
["Ignore File" git-ignore-file t]
["Remove File" git-remove-file t]
+ ["Insert File" git-insert-file t]
["Find File" git-find-file t]
["View File" git-view-file t]