"log" "--max-count=1" "--pretty=format:%B" rev)))
(defun vc-git--assert-allowed-rewrite (rev)
- (when (and (not (eq vc-allow-rewriting-published-history 'no-ask))
+ (when (and (not (and vc-allow-rewriting-published-history
+ (not (eq vc-allow-rewriting-published-history 'ask))))
;; Check there is an upstream.
(with-temp-buffer
(vc-git--out-ok "config" "--get"
"--pretty=format:%H"
"@{upstream}..HEAD")))))
(unless (or (cl-member rev outgoing :test #'string-prefix-p)
- (and vc-allow-rewriting-published-history
+ (and (eq vc-allow-rewriting-published-history 'ask)
(yes-or-no-p
(format "Commit %s appears published; allow rewriting history?"
rev))))
see \"Recovering from Upstream Rebase\" in the Man page git-rebase(1).
Normally, Emacs refuses to run VCS commands that it thinks will rewrite
-published history. If you customize this variable to a non-nil value,
-Emacs will instead prompt you to confirm that you really want to perform
-the rewrite. A value of `no-ask' means to proceed with no prompting."
+published history. If you customize this variable to `ask', Emacs will
+instead prompt you to confirm that you really want to perform the
+rewrite. Any other non-nil value means to proceed with no prompting.
+
+We recommend customizing this variable to `ask' or leaving it nil,
+because if published history is rewritten unexpectedly it can be fairly
+time-consuming to recover. Only customize this variable to a non-nil
+value other than `ask' if you have a strong grasp of the VCS in use."
:type '(choice (const :tag "Don't allow" nil)
- (const :tag "Prompt to allow" t)
- (const :tag "Allow without prompting" no-ask))
+ (const :tag "Prompt to allow" ask)
+ (const :tag "Allow without prompting" t))
:version "31.1")
\f