I've never really used
vc but it looks like it only supports add or commit actions.
magit must have some of the machinery to achieve this, but browsing its codebase didn't reveal anything obvious.
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
I guess you don't want to:
So, let me suggest this function, courtesy of Nicholas Bishop:
(defun git-add-current-buffer () "call 'git add [current-buffer]'" (interactive) (let* ((buffile (buffer-file-name)) (output (shell-command-to-string (concat "git add " (buffer-file-name))))) (message (if (not (string= output "")) output (concat "Added " buffile)))))
The next thing is probably set a custom shortcut for that function.