restechnica / semverbot

A CLI which automates semver versioning.
Mozilla Public License 2.0
133 stars 6 forks source link

Mode `git-commit` doesn't appear to support parsing multi-line commit messages #45

Closed mcblair closed 1 year ago

mcblair commented 1 year ago

Repo steps:

  1. Make commit with the following commit message:
    My work.
    [release]
  2. Run sbot predict version, output:
    
    % sbot predict version
    Error: failed to detect mode from git commit message "My work.
    " with delimiters "[]"
    Usage:
    sbot predict version [flags]

Flags: -h, --help help for version -m, --mode string sbot mode (default "auto")

Global Flags: -c, --config string configures which config file to use (default ".semverbot.toml")



Success case:
1. Make commit with the following commit message: `My work. [release]`.
2. Run `sbot predict version`, output: `1.0.0`
shiouen commented 1 year ago

Hi @mcblair

I am looking into it, I just tried to reproduce this issue and I do not get an error with that commit message, but there is a subtle difference in output from git. The [release] part appears to be cut out from your git output. I am on unix, which OS are you on?

Could you run the following and post its output? git --no-pager show -s --format=%s

ToneVDB commented 1 year ago

On a mac M1 , when running the below in a shell:

➜  testrepo git:(master) ✗ git commit -m 'my work
quote> [release]'
[master 86afadb] my work [release]
 1 file changed, 3 insertions(+)
➜  testrepo git:(master) sbot predict version
1.0.0

It seems to work. @mcblair How did you make the newline? Are you using git from the commandline?

shiouen commented 1 year ago

closing stale issue