Add config to add flags for git commit command and document both

This commit is contained in:
Adel Qalieh 2020-07-05 10:23:45 -04:00
parent dd0c2441de
commit 2c0488869a
2 changed files with 16 additions and 1 deletions

View file

@ -101,3 +101,11 @@
- =gac-debounce-interval= :: - =gac-debounce-interval= ::
A number specifying a buffer between automatic commits in seconds. Wait with A number specifying a buffer between automatic commits in seconds. Wait with
making an actual commit until this number of seconds elapses. making an actual commit until this number of seconds elapses.
- =gac-add-additional-flag= ::
A string that can be used to add additional command line flags to the ~git
add~ command.
- =gac-commit-additional-flag= ::
A string that can be used to add additional command line flags to the ~git
commit~ command.

View file

@ -75,6 +75,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-commit-additional-flag ""
"Flag to add to the git commit command."
:tag "git commit flag"
:group 'git-auto-commit-mode
:type 'string)
(defcustom gac-debounce-interval nil (defcustom gac-debounce-interval nil
"Debounce automatic commits to avoid hammering Git. "Debounce automatic commits to avoid hammering Git.
@ -169,7 +175,8 @@ Default to FILENAME."
(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)
" " gac-commit-additional-flag))))
(defun gac-push (buffer) (defun gac-push (buffer)
"Push commits to the current upstream. "Push commits to the current upstream.