These only exist to help me learn Factor. They're not particularly tested and quite likey to break. They're definitely not to be taken too seriously.
Run from a git repository passing the partial name of a local or remote branch as the argument.
For example:
git checkout-match mast
Will checkout master (if no other branches contain 'mast')
If a single match is found the branch will be checked out. If that match only exists as a remote branch, then a new local branch of the same name will be created to track the remote version and it will be checked out.
If no matches or multiple matches are found, you will be informed.
Ensure you have Factor installed.
Clone the project.
Compiled
Load the Factor listener and:
Add the project's location to Factor's vocab root
USE: vocabs.loader
"path/to/project" add-vocab-root
and then run:
USING: tools.deploy git-checkout-match ;
"git-checkout-match" deploy
This should create a binary called git-checkout-match in FACTOR_ROOT/git-checkout-match/ . Put this somewhere on your path.
Script
This approach has only been tried on Unix systems and follows the instruction from the Scripting Cookbook in the Factor documentation.
Copy git-checkout-match.factor to somewhere on your path and rename it to git-checkout-match.