Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fromCommit doesn't works #47

Open
Edivad99 opened this issue Aug 11, 2023 · 3 comments
Open

fromCommit doesn't works #47

Edivad99 opened this issue Aug 11, 2023 · 3 comments

Comments

@Edivad99
Copy link

This is the piece of code that doesn't work:

tasks.register('makeChangelog', GitChangelogTask) {
    fromRepo = projectDir.absolutePath.toString()
    file = file('CHANGELOG.md')
    fromCommit = '5062fd494493e12b6419d2af2fa3a73ff5119ece'
    toRef = 'HEAD'
    templateContent = file('changelog.mustache').text
    untaggedName = 'Next release'
}

It produces this error: https://github.com/railcraft-reborn/railcraft/actions/runs/5835400872/job/15826896012#step:6:41
While if I use the date it works and doesn't cause any problems:

tasks.register('makeChangelog', GitChangelogTask) {
    fromRepo = projectDir.absolutePath.toString()
    file = file('CHANGELOG.md')
    ignoreCommitsOlderThan = LocalDate.of(2023, 8, 10).toDate()
    templateContent = file('changelog.mustache').text
    untaggedName = 'Next release'
}
@tomasbjerre
Copy link
Owner

Are you sure it clones deep enough to get this commit?

I see the clone command:
/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +7b01415eddb3dec0462ecfdd835cbe1f2ec3d25b:refs/remotes/origin/test-changelog

It has depth 1. But also looks like it is downloading a lot of commits...

I can have a closer look later.

@Edivad99
Copy link
Author

Thanks, because I really don't know where to look anymore

@Edivad99
Copy link
Author

I tried putting fetch-depth: '0', and that works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants