Use the tracked branch as the default, if available.
Don't offer the current branch as a new base.
---
magit.el | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/magit.el b/magit.el
index f72e1ef..3788926 100644
--- a/magit.el
+++ b/magit.el
@@ -2937,7 +2937,20 @@ if any."
(interactive)
(let ((info (magit-rebase-info)))
(if (not info)
- (let ((rev (magit-read-rev "Rebase to" (magit-guess-branch))))
+ (let* ((current-branch (magit-get-current-branch))
+ (remote (when current-branch
+ (magit-get "branch" current-branch "remote")))
+ (remote-branch (when remote
+ (magit-get "branch" current-branch "merge")))
+ (rev (magit-read-rev "Rebase to"
+ (when (and remote-branch
+ (string-match
"refs/heads/\\(.*\\)" remote-branch))
+ (concat (match-string 1 remote-branch)
+ " (" remote ")"))
+ (if current-branch
+ (cons (concat "refs/heads/"
current-branch)
+ magit-uninteresting-refs)
+ magit-uninteresting-refs))))
(if rev
(magit-run-git "rebase" (magit-rev-to-git rev))))
(let ((cursor-in-echo-area t)
--
1.7.0.4