mirror of
https://github.com/cool-RR/PySnooper.git
synced 2026-01-24 02:24:55 +00:00
Improve generate_authors.py to specify branch
This commit is contained in:
parent
bd72e6c786
commit
f4cafcc767
1 changed files with 10 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue