diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2025-05-18 16:25:50 +0200 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2025-05-18 16:25:50 +0200 |
| commit | 75c61919994a23494152f726102898456a6055b7 (patch) | |
| tree | 055aadd2d7195a846be291203702e90af59ac5c0 /lisp | |
| parent | c556fee1bd3ccc44da9f2322ec17dc5c3f0ef5be (diff) | |
magit-stash-read-message: Also offer "On branch: " as history element
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/magit-stash.el | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/magit-stash.el b/lisp/magit-stash.el index df93ae0..a4b5704 100644 --- a/lisp/magit-stash.el +++ b/lisp/magit-stash.el @@ -173,14 +173,16 @@ while two prefix arguments are equivalent to `--all'." The message that Git would have picked, is available as the default (used when the user enters the empty string) and as -the next history element (which can be accessed with \ -\\<minibuffer-local-map>\\[next-history-element])." - (read-string (format "Stash message (default: On%s:%s): " - (magit--ellipsis) (magit--ellipsis)) - nil nil - (format "On %s: %s" - (or (magit-get-current-branch) "(no branch)") - (magit-rev-format "%h %s")))) +the second future history element. The first future history +element is just \"On BRANCH: \". Future history elements can +be accessed using \\<minibuffer-local-map>\\[next-history-element])." + (let ((branch (or (magit-get-current-branch) "(no branch)")) + (ellipsis (magit--ellipsis))) + (read-string (format "Stash message (default: On%s:%s): " ellipsis ellipsis) + nil nil + (list (format "On %s: " branch) + (format "On %s: %s" branch + (magit-rev-format "%h %s")))))) (defun magit-stash-read-message-traditional () "Read a message from the minibuffer, to be used for a stash. |
