Commit fd19cb8d authored by Jonas Bernoulli's avatar Jonas Bernoulli

Fine-tune confirming edits of published commits

Use three different symbols to identify such actions, so
that they can be added to `magit-no-confirm' individually.
parent da01d465
......@@ -305,7 +305,7 @@ depending on the value of option `magit-commit-squash-confirm'."
(--when-let (magit-list-publishing-branches commit)
(let ((m1 "This commit has already been published to ")
(m2 ".\nDo you really want to modify it"))
(magit-confirm 'edit-published
(magit-confirm 'amend-published
(concat m1 "%s" m2)
(concat m1 "%i public branches" m2)
nil it))))
......
......@@ -342,7 +342,8 @@ points at it) otherwise."
(file (expand-file-name (oref chunk orig-file)
(magit-toplevel))))
(if rebase
(magit-rebase-edit-commit rev (magit-rebase-arguments))
(let ((magit--rebase-published-symbol 'edit-published))
(magit-rebase-edit-commit rev (magit-rebase-arguments)))
(magit-checkout (or (magit-rev-branch rev) rev)))
(unless (file-equal-p file buffer-file-name)
(let ((blame-type (and magit-blame-mode magit-blame-type)))
......
......@@ -570,6 +570,8 @@ START has to be selected from a list of recent commits."
,message ,editor ,delay-edit-confirm ,noassert))
message)))
(defvar magit--rebase-published-symbol nil)
(defun magit-rebase-interactive-assert (since &optional delay-edit-confirm)
(let* ((commit (if (string-suffix-p "^" since)
;; If SINCE is "REV^", then the user selected
......@@ -588,7 +590,7 @@ START has to be selected from a list of recent commits."
(not (--all-p (magit-rev-equal it commit) branches))))
(let ((m1 "Some of these commits have already been published to ")
(m2 ".\nDo you really want to modify them"))
(magit-confirm 'edit-published
(magit-confirm (or magit--rebase-published-symbol 'rebase-published)
(concat m1 "%s" m2)
(concat m1 "%i public branches" m2)
nil branches))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment