@matheusbsbs / matheus-bagliano / commits / b0a53e9e56
Fork 0

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 <julliard@winehq.org>

Alexandre Julliard committed Aug 4, 2008 at 09:30 UTC b0a53e9e56d0a501aebc99d3614be413e91613f6
1 file changed +7
contrib/emacs/git.el
+7
@@ -1019,6 +1019,11 @@ Return the list of files that haven't been handled."
1019 (setq node (ewoc-prev git-status node)))
1020 (ewoc-goto-node git-status last)))
1021
1022 +(defun git-insert-file (file)
1023 + "Insert file(s) into the git-status buffer."
1024 + (interactive "fInsert file: ")
1025 + (git-update-status-files (list (file-relative-name file))))
1026 +
1027 (defun git-add-file ()
1028 "Add marked file(s) to the index cache."
1029 (interactive)
@@ -1449,6 +1454,7 @@ amended version of it."
1454 (define-key map "\r" 'git-find-file)
1455 (define-key map "g" 'git-refresh-status)
1456 (define-key map "i" 'git-ignore-file)
1457 + (define-key map "I" 'git-insert-file)
1458 (define-key map "l" 'git-log-file)
1459 (define-key map "m" 'git-mark-file)
1460 (define-key map "M" 'git-mark-all)
@@ -1505,6 +1511,7 @@ amended version of it."
1511 ["Revert File" git-revert-file t]
1512 ["Ignore File" git-ignore-file t]
1513 ["Remove File" git-remove-file t]
1514 + ["Insert File" git-insert-file t]
1515 "--------"
1516 ["Find File" git-find-file t]
1517 ["View File" git-view-file t]