Created
January 30, 2009 16:28
-
-
Save wilkes/55127 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'magit) | |
(defun my-magit-run (&rest args) | |
(apply #'magit-run (cons "git" args)) | |
(message (mapconcat #'identity args " "))) | |
(defun my-magit-hack () | |
(interactive) | |
(let ((working-branch (magit-get-current-branch))) | |
(my-magit-run "checkout" "master") | |
(my-magit-run "pull" "-v" "origin" "master") | |
(my-magit-run "checkout" working-branch) | |
(my-magit-run "rebase" "master") | |
(message "Magit HACK done."))) | |
(defun my-magit-ship () | |
(interactive) | |
(let ((working-branch (magit-get-current-branch))) | |
(my-magit-run "checkout" "master") | |
(my-magit-run "merge" working-branch) | |
(my-magit-run "push" "origin" "master") | |
(my-magit-run "checkout" working-branch) | |
(message "Magit SHIP done."))) | |
(define-key magit-mode-map (kbd "y") 'my-magit-hack) | |
(define-key magit-mode-map (kbd "Y") 'my-magit-ship) | |
(provide 'my-magit) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment