Add option to have it be completely silent when committing

This commit is contained in:
Adel Qalieh 2020-07-05 10:28:19 -04:00
parent 2c0488869a
commit 14e4def248
2 changed files with 14 additions and 1 deletions

View file

@ -109,3 +109,8 @@
- =gac-commit-additional-flag= :: - =gac-commit-additional-flag= ::
A string that can be used to add additional command line flags to the ~git A string that can be used to add additional command line flags to the ~git
commit~ command. 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.

View file

@ -81,6 +81,12 @@ If non-nil a git push will be executed after each commit."
:group 'git-auto-commit-mode :group 'git-auto-commit-mode
:type 'string) :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 (defcustom gac-debounce-interval nil
"Debounce automatic commits to avoid hammering Git. "Debounce automatic commits to avoid hammering Git.
@ -172,7 +178,9 @@ Default to FILENAME."
(file-name-nondirectory buffer-file))) (file-name-nondirectory buffer-file)))
(commit-msg (gac--commit-msg buffer-file)) (commit-msg (gac--commit-msg buffer-file))
(default-directory (file-name-directory 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) (concat "git add " gac-add-additional-flag " " (shell-quote-argument filename)
gac-shell-and gac-shell-and
"git commit -m " (shell-quote-argument commit-msg) "git commit -m " (shell-quote-argument commit-msg)