al-magit.el 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. ;;; al-magit.el --- Additional functionality for magit
  2. ;; Copyright © 2015–2017 Alex Kost
  3. ;; This program is free software; you can redistribute it and/or modify
  4. ;; it under the terms of the GNU General Public License as published by
  5. ;; the Free Software Foundation, either version 3 of the License, or
  6. ;; (at your option) any later version.
  7. ;;
  8. ;; This program is distributed in the hope that it will be useful,
  9. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. ;; GNU General Public License for more details.
  12. ;;
  13. ;; You should have received a copy of the GNU General Public License
  14. ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. ;;; Code:
  16. (require 'magit-diff)
  17. (require 'git-commit)
  18. (require 'al-buffer)
  19. ;;;###autoload
  20. (defun al/magit-switch-buffer ()
  21. "Switch to a magit status buffer preferably using `ivy-read'."
  22. (interactive)
  23. (al/switch-buffer "Magit buffer: "
  24. :initial-input "*magit: "))
  25. ;;;###autoload
  26. (defun al/git-commit-co-authored (name mail)
  27. "Insert a header acknowledging that you have co-authored the commit."
  28. (interactive (git-commit-self-ident))
  29. (git-commit-insert-header "Co-authored-by" name mail))
  30. ;;;###autoload
  31. (defun al/magit-show-commit (commit)
  32. "Like `magit-show-commit' but always prompt for COMMIT."
  33. (interactive (list (magit-read-branch-or-commit "Show commit")))
  34. (magit-show-commit commit))
  35. (provide 'al-magit)
  36. ;;; al-magit.el ends here