summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2017-03-18 00:46:51 -0400
committerKyle Meyer <kyle@kyleam.com>2017-03-18 00:46:51 -0400
commit8fc740dbaaca1a24fc1187533bf699913b9f5778 (patch)
tree3d0dd7459ea1d508f0273681fbb08eb77a5fbf1a
parent0bd73fb1ba0b5f2d998c8b585a06deda3cc49135 (diff)
downloademacs.d-8fc740dbaaca1a24fc1187533bf699913b9f5778.tar.gz
magit-branch-and-checkout-from-current: Add default value
Appending "-tmp" to the current branch name isn't a great default value, but it allows me to quickly pull it in with M-n and base the new branch name off of the current one, which I often do, especially for trying out a different approach on a topic branch.
-rw-r--r--lisp/km-magit.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/km-magit.el b/lisp/km-magit.el
index bf65c4e..fa7d3af 100644
--- a/lisp/km-magit.el
+++ b/lisp/km-magit.el
@@ -204,7 +204,9 @@ date."
This is equivalent to running `magit-branch-and-checkout' with
START-POINT set to the current branch.
\n(git checkout -b BRANCH)"
- (interactive (list (magit-read-string "Branch name")))
+ (interactive (list (magit-read-string "Branch name" nil nil
+ (--when-let (magit-get-current-branch)
+ (concat it "-tmp")))))
(magit-run-git "checkout" "-b" branch))
(defun km/magit-branch-backup-current ()