Created
August 30, 2016 13:14
-
-
Save invisiblek/e5a3c112b68527094c0e076d2348e137 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
branches=['staging/cm-14.0', 'cm-14.0', 'refs/heads/cm-14.0', 'refs/heads/staging/cm-14.0'] | |
print("Current:") | |
for b in branches: | |
print(b + " -> " + b.split('/')[-1]) | |
print("") | |
print("With patch:") | |
for b in branches: | |
print(b + " -> " + "/".join(b.split('/')[2:])) | |
print("") | |
print("Stripping 'refs/heads/':") | |
for b in branches: | |
print(b + " -> " + b.replace("refs/heads/","")) | |
print("") | |
print("Splitting 'refs/heads/':") | |
for b in branches: | |
print(b + " -> " + b.split("refs/heads/")[-1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment