I'm currently in the process of writing an extension to Magit, which will add the commands from the git plugin Git Town. You can see my current process here.
I've worked my way to a rough understanding of how to execute the commands I need to run and have a roughly functioning extension now. However, I've run into a wall that I can't seem to find a way over.
Certain commands, such as git town sync
, will at times encounter either:
- An error, such as pending configuration or conflict issues,
- A confirmation asking questions about the issued command, such as what the parent branch is.
I have no idea how to collect, display, and respond to these situations using Magit, and currently have to fall back to a normal terminal. I've been scouring the docs trying to find out the correct way to handle this situation (which I feel to be common with git workflows) and have come up empty-handed.
So, my question is: how do I capture git command output, display it to the user, and allow them to respond, from within a magit extension?