Permalink
Browse files

don't monkey patch magit rebase interactive

  • Loading branch information...
1 parent 219076b commit fe4dfcf74a68ba5ecb857152a6928dbb509a931d @langmartin committed Aug 28, 2012
Showing with 29 additions and 26 deletions.
  1. +29 −26 rc-monkey-patches.el
View
@@ -1,29 +1,32 @@
-(ignore
- ;; These fixes were required for magit 0.8.
- (require 'magit)
- (defvar magit-editor "/Applications/Emacs.app/Contents/MacOS/bin/emacsclient")
- (defun magit-interactive-rebase ()
- "Start a git rebase -i session, old school-style."
- (interactive)
- (unless (magit-server-running-p)
- (server-start))
- (let* ((section (get-text-property (point) 'magit-section))
- (commit (and (member 'commit (magit-section-context-type section))
- (magit-section-info section)))
- (old-editor (getenv "GIT_EDITOR")))
- (setenv "GIT_EDITOR" (or magit-editor
- (locate-file "emacsclient" exec-path)))
- (unwind-protect
- (magit-run-git-async
- "rebase" "-i"
- (or (and commit (concat commit "^"))
- (magit-read-rev "Interactively rebase to" (magit-guess-branch))))
- (if old-editor
- (setenv "GIT_EDITOR" old-editor)))))
+(require 'magit)
+;; (defvar magit-editor "/Applications/Emacs.app/Contents/MacOS/bin/emacsclient")
- (defun magit-push ()
- (interactive)
- (message "This monkey-patched version of push only pushes what you have configured in .git/config for the default push. Do the rest on the command line.")
- (magit-run-git-async "push" "-v")))
+;; (defun magit-interactive-rebase ()
+;; "Start a git rebase -i session, old school-style."
+;; (interactive)
+;; (unless (magit-server-running-p)
+;; (server-start))
+;; (let* ((section (get-text-property (point) 'magit-section))
+;; (commit (and (member 'commit (magit-section-context-type section))
+;; (magit-section-info section)))
+;; (old-editor (getenv "GIT_EDITOR")))
+;; (setenv "GIT_EDITOR" (or magit-editor
+;; (locate-file "emacsclient" exec-path)))
+;; (unwind-protect
+;; (magit-run-git-async
+;; "rebase" "-i"
+;; (or (and commit (concat commit "^"))
+;; (magit-read-rev "Interactively rebase to" (magit-guess-branch))))
+;; (if old-editor
+;; (setenv "GIT_EDITOR" old-editor)))))
+
+(defun magit-push (&optional prefix)
+ (interactive "P")
+ (message "This monkey-patched version of push only pushes what you have configured in .git/config for the default push. Do the rest on the command line.")
+ (if (not prefix)
+ (magit-run-git-async "push" "-v")
+ (magit-run-git-with-input
+ (read-from-minibuffer
+ "Run: git origin "))))
(provide 'rc-monkey-patches)

0 comments on commit fe4dfcf

Please sign in to comment.