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.
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.