Skip to content

Commit

Permalink
deletemergesquashed py3
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Jun 30, 2020
1 parent 453b386 commit cd71b7b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bin/git-delete-squashed-and-merged-branches
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# prereqs:
Expand Down Expand Up @@ -41,7 +41,7 @@ def get_branch_heads():
branch_to_sha = []
# %09 is a tab, which we later split on
refsoutput = subprocess.check_output(["git", "for-each-ref", "--sort=-committerdate", "refs/heads/", "--format=%(refname)%09%(objectname)"])
lines = refsoutput.split('\n')
lines = refsoutput.decode().split('\n')

for line in lines:
if not line:
Expand All @@ -59,10 +59,10 @@ def main():
retval = 0
items = get_branch_heads()

print 'Looking at {} total local heads, from newest to oldest.'.format(len(items))
print(f"Looking at {len(items)} total local heads, from newest to oldest.")

for [branch, sha] in items:
print '\n'
print('\n')
time.sleep(2) # search only allows 30 req/min. https://developer.github.com/v3/search/#rate-limit
res = G.search_issues(sha)
shortsha = sha[0:7]
Expand All @@ -81,7 +81,7 @@ def main():
msg = '🔃 All PRs still open'
retval = 2

print ('{}{}{} ({}):\n{}'.format(yellow, branch, reset, shortsha, msg))
print('{}{}{} ({}):\n{}'.format(yellow, branch, reset, shortsha, msg))

if retval == 0:
if DRY_RUN:
Expand Down

0 comments on commit cd71b7b

Please sign in to comment.