New git flow branch from Trello card URL
I like to name my git-flow feature branches after the associated Trello card. When I copy a trello URL to the clipboard (e.g., https://trello.com/c/AbcDEfG/name-of-card
) and type gffs
at the prompt, TextExpander will replace the text with:
$ git flow feature start AbcDEfG/name-of-card
To do this, I define a TextExpander snippet that contains the following script:
#!/usr/bin/env python
import richxerox
import re
import subprocess
import sys
url = richxerox.paste()
x = re.match('https://trello.com/c/(.*)', url)
if x is not None:
sys.stdout.write("git flow feature start {}".format(x.group(1)))
else:
subprocess.call(["/usr/bin/say", "Clipboard does not contain a Trello card url"])
#%-
Written by Lorin Hochstein
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Osx
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#