Skip to content

Commit

Permalink
cockpit-lib-update: show the git shortlog in pull request body
Browse files Browse the repository at this point in the history
  • Loading branch information
jelly authored and martinpitt committed Oct 3, 2024
1 parent b819c72 commit 88bbc82
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cockpit-lib-update
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ def run(context, verbose=False, **kwargs):
with tempfile.TemporaryDirectory('cockpit-repo') as tmpdir:
tmpdir = Path(tmpdir)
clone_dir = 'cockpit'
commit = cockpit_repo_commit.partition('#')[0].strip()
subprocess.check_call(['git', 'clone', cockpit_repo_url, clone_dir], cwd=tmpdir)
git_describe = subprocess.check_output(['git', 'describe'], cwd=tmpdir / clone_dir).decode().strip()
git_head = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=tmpdir / clone_dir).decode().strip()
git_shortlog = subprocess.check_output(['git', 'shortlog', f'{commit}...'],
cwd=tmpdir / clone_dir).decode().strip()

try:
# when HEAD is not tagged, this looks like "290-9-g4a6d86f5b"
Expand All @@ -81,6 +84,7 @@ def run(context, verbose=False, **kwargs):
title = f"Makefile: Update Cockpit lib to {git_head[:32]}"
branch = task.branch('cockpit-lib', title, pathspec=makefile, **kwargs)
kwargs["title"] = title
kwargs["body"] = git_shortlog
task.pull(branch, **kwargs)


Expand Down

0 comments on commit 88bbc82

Please sign in to comment.