Skip to content

fix(plugins): handle repos with fewer than 10 commits in bump auto#236

Merged
indaco merged 2 commits intomainfrom
fix/commit-parser-shallow-repo-fallback
Mar 19, 2026
Merged

fix(plugins): handle repos with fewer than 10 commits in bump auto#236
indaco merged 2 commits intomainfrom
fix/commit-parser-shallow-repo-fallback

Conversation

@indaco
Copy link
Copy Markdown
Owner

@indaco indaco commented Mar 19, 2026

Description

When running sley bump auto in a repo with no tags and fewer than 10 commits, both the commit-parser and changelog-generator plugins fell back to HEAD~10, which is an invalid ref in shallow repos. This caused git log to fail with "unknown revision."

This PR extracts a shared git.SafeFallbackSince helper in internal/git/ref.go that counts available commits and falls back to the root commit hash when the repo has fewer than n commits. Both gitlog.GitLog and changeloggenerator.GitOps now use it instead of hardcoding HEAD~10.

Related Issue

  • None

Notes for Reviewers

  • None

@indaco indaco added bug Something isn't working plugin labels Mar 19, 2026
@indaco indaco merged commit 5021cd3 into main Mar 19, 2026
7 checks passed
@indaco indaco deleted the fix/commit-parser-shallow-repo-fallback branch March 19, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant