mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Fix possible wrong FROM_REF by using merge-base commit
This commit is contained in:
parent
dd2a0ed755
commit
c150fe6f0d
@ -368,11 +368,13 @@ def main():
|
||||
|
||||
logging.info("Using %s..%s as changelog interval", FROM_REF, TO_REF)
|
||||
|
||||
# use merge-base commit as a starting point, if used ref in another branch
|
||||
base_commit = runner.run(f"git merge-base '{FROM_REF}^{{}}' '{TO_REF}^{{}}'")
|
||||
# Get starting and ending dates for gathering PRs
|
||||
# Add one day after and before to mitigate TZ possible issues
|
||||
# `tag^{}` format gives commit ref when we have annotated tags
|
||||
# format %cs gives a committer date, works better for cherry-picked commits
|
||||
from_date = runner.run(f"git log -1 --format=format:%cs '{FROM_REF}^{{}}'")
|
||||
from_date = runner.run(f"git log -1 --format=format:%cs '{base_commit}'")
|
||||
to_date = runner.run(f"git log -1 --format=format:%cs '{TO_REF}^{{}}'")
|
||||
merged = (
|
||||
date.fromisoformat(from_date) - timedelta(1),
|
||||
|
Loading…
Reference in New Issue
Block a user