From 14e4def248d0d80c8f14bf2796493a3ef5b4b044 Mon Sep 17 00:00:00 2001 From: Adel Qalieh Date: Sun, 5 Jul 2020 10:28:19 -0400 Subject: [PATCH] Add option to have it be completely silent when committing --- README.org | 5 +++++ git-auto-commit-mode.el | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index ef8af5b..3ea46ae 100644 --- a/README.org +++ b/README.org @@ -109,3 +109,8 @@ - =gac-commit-additional-flag= :: A string that can be used to add additional command line flags to the ~git commit~ command. + + - =gac-silent-message-p= :: + A boolean value indicating whether to display the commit summary message, + which is usually displayed in the minibuffer. The default is ~nil~, meaning + that the summary would be displayed on every commit. diff --git a/git-auto-commit-mode.el b/git-auto-commit-mode.el index 55f4849..d5f8afc 100644 --- a/git-auto-commit-mode.el +++ b/git-auto-commit-mode.el @@ -81,6 +81,12 @@ If non-nil a git push will be executed after each commit." :group 'git-auto-commit-mode :type 'string) +(defcustom gac-silent-message-p nil + "Should git output be output to the message area?" + :tag "Quiet message output" + :group 'git-auto-commit-mode + :type 'boolean) + (defcustom gac-debounce-interval nil "Debounce automatic commits to avoid hammering Git. @@ -172,7 +178,9 @@ Default to FILENAME." (file-name-nondirectory buffer-file))) (commit-msg (gac--commit-msg buffer-file)) (default-directory (file-name-directory buffer-file))) - (shell-command + (funcall (if gac-silent-message-p + #'call-process-shell-command + #'shell-command) (concat "git add " gac-add-additional-flag " " (shell-quote-argument filename) gac-shell-and "git commit -m " (shell-quote-argument commit-msg)