mirror of
https://github.com/cool-RR/PySnooper.git
synced 2026-04-23 03:00:38 -04:00
Improve generate_authors.py to specify branch
This commit is contained in:
@@ -28,10 +28,10 @@ def drop_recurrences(iterable):
|
||||
yield item
|
||||
|
||||
|
||||
def iterate_authors_by_chronological_order():
|
||||
def iterate_authors_by_chronological_order(branch):
|
||||
log_call = subprocess.run(
|
||||
(
|
||||
'git', 'log', 'master', '--encoding=utf-8', '--full-history',
|
||||
'git', 'log', branch, '--encoding=utf-8', '--full-history',
|
||||
'--reverse', '--format=format:%at;%an;%ae'
|
||||
),
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||
@@ -43,11 +43,16 @@ def iterate_authors_by_chronological_order():
|
||||
)
|
||||
|
||||
|
||||
def print_authors():
|
||||
for author in iterate_authors_by_chronological_order():
|
||||
def print_authors(branch):
|
||||
for author in iterate_authors_by_chronological_order(branch):
|
||||
sys.stdout.buffer.write(author.encode())
|
||||
sys.stdout.buffer.write(b'\n')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print_authors()
|
||||
try:
|
||||
branch = sys.argv[1]
|
||||
except IndexError:
|
||||
branch = 'master'
|
||||
|
||||
print_authors(branch)
|
||||
|
||||
Reference in New Issue
Block a user