Skip to content

Commit

Permalink
Add --from option for update_changelog.py
Browse files Browse the repository at this point in the history
This is used to create the changes information for the
activation package properly
  • Loading branch information
schaefi committed Jan 21, 2025
1 parent 62c0f04 commit 69517c1
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions helper/update_changelog.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/usr/bin/python3
"""
usage: update_changelog (--since=<reference_file>|--file=<reference_file>)
[--from=<path>...]
[--utc]
[--fix]
arguments:
--since=<reference_file>
changes since the latest entry in the reference file
--from=<path>
changes which affected the given file or path
--file=<reference_file>
changes from the given file
--utc
Expand Down Expand Up @@ -73,12 +76,21 @@
date_reference = parser.parse(latest_date)

# Read git history since latest entry from reference file
git_arguments = [
'git', 'log'
]
git_arguments.append('--no-merges')
git_arguments.append('--format=fuller')
if latest_date:
git_arguments.append('--since="{0}"'.format(latest_date))
if arguments.get('--from'):
for source_repo in arguments.get('--from'):
git_arguments.append(source_repo)

process = subprocess.Popen(
[
'git', 'log', '--no-merges', '--format=fuller',
'--since="{0}"'.format(latest_date)
], stdout=subprocess.PIPE
git_arguments, stdout=subprocess.PIPE
)

from_git_log = True
for line in iter(process.stdout.readline, b''):
if line.startswith(b'commit'):
Expand Down

0 comments on commit 69517c1

Please sign in to comment.