In response to a question about extending magit's push menu, I have successfully added a command that logs into a remote server, pulls from where I am, and runs make:
(defun magit-update-course-repo () "Run pull-and-mk-repo remotely to update the course repo" (interactive) (let ((cc (course-number-and-update-command))) (when cc (let* ((command (cdr cc))) (shell-command command) (magit-fetch-all-no-prune)))))
command here is an
ssh command which runs a script, and the whole thing takes many seconds to complete. During that time, the user interface does not acknowledge that anything is happening, and indeed emacs seems to freeze. Eventually, however, the magit status window updates, and a
*Shell Command Output* is shown in another buffer.
In other words, the functionality is there, but the user experience is not good.
I know magit provides internal tools that can do better than
shell-command, but I am having trouble understanding the documentation and reading the source code. What magit functions should I use to achieve the following goals?
The moment the command launches, magit's user interface acknowledges that something is happening, even if it takes a long time to complete.
The command's output goes into magit's "process buffer", just like the output from normal git commands.
Ideally, while the command is running, the user can get on with life and do other things inside emacs.
I have gotten as far as discovering the existence of command
magit-start-process, but I have not figured out how to use it.