Skip to content

Commit

Permalink
git.el: Add an insert file command.
Browse files Browse the repository at this point in the history
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 <julliard@winehq.org>
  • Loading branch information
Alexandre Julliard committed Nov 23, 2008
1 parent 433ee03 commit b0a53e9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions contrib/emacs/git.el
Original file line number Diff line number Diff line change
Expand Up @@ -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."
(interactive)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit b0a53e9

Please sign in to comment.