From 861e555983ac29319d579978a2164686df0e6fc9 Mon Sep 17 00:00:00 2001 From: Phil Jackson Date: Mon, 9 Aug 2010 22:58:11 +0100 Subject: [PATCH] Pull uses --rebase with prefix arg. --- magit.el | 8 +++++--- magit.texi | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/magit.el b/magit.el index cc61be88..17887bb5 100644 --- a/magit.el +++ b/magit.el @@ -3035,15 +3035,17 @@ update it." (remote (magit-run-git-async "fetch" remote)) (t (magit-run-git-async "remote" "update")))) -(magit-define-command pull () - (interactive) +(magit-define-command pull (&optional rebase) + "Run git pull against the current remote. With a prefix arg +will run pull with --rebase." + (interactive "P") (let* ((branch (magit-get-current-branch)) (config-branch (and branch (magit-get "branch" branch "merge"))) (merge-branch (or config-branch (magit-read-rev (format "Pull from"))))) (if (and branch (not config-branch)) (magit-set merge-branch "branch" branch "merge")) - (magit-run-git-async "pull" "-v"))) + (apply 'magit-run-git-async `("pull" "-v" ,@(and rebase '("--rebase")))))) (eval-when-compile (require 'pcomplete)) diff --git a/magit.texi b/magit.texi index 5ae45b6a..abe7ab5d 100644 --- a/magit.texi +++ b/magit.texi @@ -661,9 +661,10 @@ only push the current branch to the remote. In other words, it will run remote if it doesn't exist already. The local branch will be configured so that it pulls from the new remote branch. -Typing @kbd{f} will run @code{git remote update}. With a prefix arg, it -will prompt for the name of the remote to update. Typing @kbd{F} will -run @code{git pull}. When you don't have a default branch configured to +Typing @kbd{f} will run @code{git remote update}. With a prefix arg, +it will prompt for the name of the remote to update. Typing @kbd{F} +will run @code{git pull} (with a prefix arg will pull with +@code{--rebase}). When you don't have a default branch configured to be pulled into the current one, you will be asked for it. If there is a default remote repository for the current branch, Magit