Variable: magit-process-prompt-functions

magit-process-prompt-functions is a customizable variable defined in magit-process.el.

Value

nil

Documentation

List of functions used to forward arbitrary questions to the user.

Magit has dedicated support for forwarding username and password prompts and Yes-or-No questions asked by Git and its subprocesses to the user. This can be customized using other options in the magit-process customization group.

If you encounter a new question that isn't handled by default, then those options should be used instead of this hook.

However subprocesses may also ask questions that differ too much from what the code related to the above options assume, and this hook allows users to deal with such questions explicitly.

Each function is called with the process and the output string as arguments until one of the functions returns non-nil. The function is responsible for asking the user the appropriate question using, e.g., read-char-choice and then forwarding the answer to the process using process-send-string.

While functions such as magit-process-yes-or-no-prompt may not be sufficient to handle some prompt, it may still be of benefit to look at the implementations to gain some insights on how to implement such functions.

This variable was added, or its default value changed, in magit version 3.0.0.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-process.el
(defcustom magit-process-prompt-functions nil
  "List of functions used to forward arbitrary questions to the user.

Magit has dedicated support for forwarding username and password
prompts and Yes-or-No questions asked by Git and its subprocesses
to the user.  This can be customized using other options in the
`magit-process' customization group.

If you encounter a new question that isn't handled by default,
then those options should be used instead of this hook.

However subprocesses may also ask questions that differ too much
from what the code related to the above options assume, and this
hook allows users to deal with such questions explicitly.

Each function is called with the process and the output string
as arguments until one of the functions returns non-nil.  The
function is responsible for asking the user the appropriate
question using, e.g., `read-char-choice' and then forwarding the
answer to the process using `process-send-string'.

While functions such as `magit-process-yes-or-no-prompt' may not
be sufficient to handle some prompt, it may still be of benefit
to look at the implementations to gain some insights on how to
implement such functions."
  :package-version '(magit . "3.0.0")
  :group 'magit-process
  :type 'hook)