restechnica / semverbot

A CLI which automates semver versioning.
Mozilla Public License 2.0
137 stars 8 forks source link

[fix] - Use revparse to get source branch name #47

Closed MovieStoreGuy closed 1 year ago

MovieStoreGuy commented 1 year ago

Description

I've set up sbot to use mode = 'git-branch', however, I keep running up against this error:

Error: failed to detect mode from git branch name "Could not get sha1 for HEAD^2. Skipping.
" with delimiters "/"

I thought it may have been an issue with shell, so I had tried the actual command locally:

bash -c 'git name-rev --name-only --refs=refs/head/* --refs=refs/remotes/* HEAD^2'

That returns the same error, switching the command to:

bash -c 'git name-rev --name-only --refs=refs/head/* --refs=refs/remotes/* HEAD~2'

returns a branch name :success:

shiouen commented 1 year ago

@MovieStoreGuy Is this issue still relevant? Is there a reason you closed it?

MovieStoreGuy commented 1 year ago

I had closed this out because I noticed that my project was doing squash commits so checking for the merge commit wasn't possible.