Skip to content

Instantly share code, notes, and snippets.

@invisiblek
Created August 30, 2016 13:14
Show Gist options
  • Save invisiblek/e5a3c112b68527094c0e076d2348e137 to your computer and use it in GitHub Desktop.
Save invisiblek/e5a3c112b68527094c0e076d2348e137 to your computer and use it in GitHub Desktop.
#!/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