Skip to content

Commit 4addeca

Browse files
committed
Select first commit if there is no tags
1 parent a8f0735 commit 4addeca

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

jupyter_releaser/changelog.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ def get_version_entry(
8383
branch = branch or util.get_branch()
8484
since = since or util.get_latest_tag(ref or branch, since_last_stable)
8585

86+
if since == "" :
87+
since = util.get_first_commit(ref or branch)
88+
8689
util.log(f"Getting changes to {repo} since {since} on branch {branch}...")
8790

8891
if until:

jupyter_releaser/util.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,11 @@ def get_latest_tag(source, since_last_stable=False):
280280

281281
return tags[0]
282282

283+
def get_first_commit(source):
284+
"""Get the default 'since' value for a branch"""
285+
source = source or get_branch()
286+
commit = run(f"git rev-list --max-parents=0 HEAD", quiet=True)
287+
return commit
283288

284289
def retry(cmd, **kwargs):
285290
"""Run a command with retries"""

0 commit comments

Comments
 (0)