From 8fc740dbaaca1a24fc1187533bf699913b9f5778 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 18 Mar 2017 00:46:51 -0400 Subject: 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. --- lisp/km-magit.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 () -- cgit v1.2.3