1

In my company we use a Git extension which has command-line interface that requires interaction (answering prompt). I would like to extend Magit to be able to deal with our extension. Unlike most of Magit functionality, this has to actually interact with the Git process by collecting users' input (this is company's policy, something to prevent automatic submissions, questionable as it may be, isn't a subject to change).

Ideally, in the future, I'd write a proper extension with a dedicated buffer and, font-faces and key-bindings, but for now, I'd be happy with just the ability to answer yes/no to the prompt.

2

magit already look for prompt that ask yes/no question to let user answer them.

It need the prompt to end by something like " [Yes/No]:", " (Yes|No)?: " or "[y|n]:". Look at the regexp in magit-process-yes-or-no-prompt-regexp for prompt that will be handle.

Note that if you want to change magit-process-yes-or-no-prompt-regexp, you have to be extra careful, because magit use groups in the regexp to find if it must answer "yes" or "y" to the process.

  • 1
    Note that it doesn't work on Windows (due to lack of pty) – npostavs Apr 12 '16 at 13:51
  • Sorry it's taking so long! I'll get back to it next time I need to use it. – wvxvw Apr 13 '16 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.