Skip to content

Instantly share code, notes, and snippets.

@arnab
Created July 1, 2013 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arnab/5900337 to your computer and use it in GitHub Desktop.
Save arnab/5900337 to your computer and use it in GitHub Desktop.
fx for PR
def done_remote(self, result):
remote_loc = result.split()[0]
repo_url = re.sub('^git(@|://)', 'http://', remote_loc)
# Replace the "tld:" with "tld/". See http://rubular.com/r/FK3w7CVnx5
tld_pattern = r'\.(com|net|org|co\..{2}):'
repo_url = re.sub(tld_pattern, r'.\1/', repo_url)
repo_url = re.sub('\.git$', '', repo_url)
self.repo_url = repo_url
self.run_command("git rev-parse --abbrev-ref HEAD".split(), self.done_rev_parse)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment