Support fish which uses "; and" rather than "&&" to join commands

This commit is contained in:
Stig Brautaset 2016-12-29 16:17:29 +00:00
parent 075e5f9ded
commit 2c8197e5d7

View file

@ -51,6 +51,13 @@ If non-nil a git push will be executed after each commit."
:group 'git-auto-commit-mode
:type 'boolean)
(defcustom gac-shell-and " && "
"How to join commands together in the shell. For fish shell,
you want to customise this to: \" ; and \" instead of the default."
:tag "Join shell commands"
:group 'git-auto-commit-mode
:type 'string)
(defun gac-relative-file-name (filename)
"Find the path to FILENAME relative to the git directory."
(let* ((git-dir
@ -111,7 +118,8 @@ Default to FILENAME."
(default-directory (file-name-directory buffer-file)))
(shell-command
(concat "git add " (shell-quote-argument filename)
" && git commit -m " (shell-quote-argument commit-msg)))))
gac-shell-and
"git commit -m " (shell-quote-argument commit-msg)))))
(defun gac-push ()
"Push commits to the current upstream.