errbotio / errbot

Errbot is a chatbot, a daemon that connects to your favorite chat service and bring your tools and some fun into the conversation.
http://errbot.io
GNU General Public License v3.0
3.12k stars 614 forks source link

Add repos_branch command #1523

Closed bboe closed 2 years ago

bboe commented 3 years ago

The method for doing the checkout is likely not the most efficient as it deletes everything in the working tree, and relies upon reset_index to restore all the files. Nevertheless, it appears to get the job done.

Usage:

!repos branch REPO BRANCHNAME

Note: Just like repos update, which also relies upon the same pull command, it does not support pulling in history-rewriting updates.

bboe commented 3 years ago

After testing some more, this isn't quite ready as repos update doesn't work after changing to a non-primary branch.

I can work around that by reloading the relevant plugins on branch switch, but switching branches shouldn't break any of the other commands.

I'd also like to handle the force-push case, which I think I'll solve by simply deleting the local branch before switching.