diff options
author | Gustav Hållberg <gustav@gmail.com> | 2010-04-30 00:20:20 +0200 |
---|---|---|
committer | Gustav Hållberg <gustav@gmail.com> | 2010-04-30 00:20:20 +0200 |
commit | 84e1850a7cb61f9afa61eda5fa75ca14f672eadf (patch) | |
tree | 3812cba75516c3f1387ef98c29188e29751a3385 | |
parent | a4a016302740451baa574f5be40a61bb58e7d48a (diff) | |
download | stgit-84e1850a7cb61f9afa61eda5fa75ca14f672eadf.tar.gz |
stgit.el: Ask for branch point when creating new branch
This makes sure git-config branch.<branch>.parentbranch is set correctly.
Signed-off-by: Gustav Hållberg <gustav@gmail.com>
-rw-r--r-- | contrib/stgit.el | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/contrib/stgit.el b/contrib/stgit.el index f42ad58..d3d518d 100644 --- a/contrib/stgit.el +++ b/contrib/stgit.el @@ -1494,9 +1494,16 @@ If ALL is not nil, also return non-stgit branches." ((not (string-match stgit-allowed-branch-name-re branch)) (error "Invalid branch name")) ((yes-or-no-p (format "Create branch \"%s\"? " branch)) - (stgit-capture-output nil (stgit-run "branch" "--create" "--" - branch)) - t)) + (let ((branch-point (completing-read + "Branch from (default current branch): " + (stgit-available-branches)))) + (stgit-capture-output nil + (apply 'stgit-run + `("branch" "--create" "--" + ,branch + ,@(unless (zerop (length branch-point)) + (list branch-point))))) + t))) (stgit-reload))) (defun stgit-available-refs (&optional omit-stgit) |