From 02ba70f3e3cd6f078d926848bf325e6860962cdb Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 20 May 2012 15:17:21 +0200 Subject: Show status at the end of the push --- git-auto-commit-mode.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/git-auto-commit-mode.el b/git-auto-commit-mode.el index 2daad54..910609e 100644 --- a/git-auto-commit-mode.el +++ b/git-auto-commit-mode.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemsen ;; Created: Jan 9, 2012 -;; Version: 2 +;; Version: 3 ;; Keywords: vc ;; URL: http://ryuslash.org/git-auto-commit-mode/ @@ -35,6 +35,8 @@ ;; 2 - Add ability to automatically push. +;; 3 - Shows the status when push finishes. + ;;; Code: (defvar gac-automatically-push nil @@ -75,6 +77,10 @@ user for one when it does." (let ((inhibit-read-only t)) (gac-password proc string)))) +(defun gac-process-sentinel (proc status) + "Report the process' status change." + (message "git %s" (substring status 0 -1))) + (defun gac-commit () "Commit `buffer-file-name' to git" (let* ((filename (buffer-file-name)) @@ -89,6 +95,7 @@ user for one when it does." doesn't check or ask for a remote, so the correct remote should already have been set up." (let ((proc (start-process "git" "*git-auto-push*" "git" "push"))) + (set-process-sentinel proc 'gac-process-sentinel) (set-process-filter proc 'gac-process-filter))) (defun gac-after-save-func () -- cgit v1.2.3-54-g00ecf