Skip to content

Error generating commit message when adding just a new file #21

@sergiotejon

Description

@sergiotejon

Example of the error:

❯ git ai-commit
time=2024-11-30T09:36:52.399+01:00 level=INFO msg="Querying Ollama..."
time=2024-11-30T09:36:52.399+01:00 level=INFO msg=Parameters server=http://localhost:11434 model=mistral

file(docs/example_scripts/example.sh): Create new example script

time=2024-11-30T09:36:53.546+01:00 level=ERROR msg="Invalid commit message" retry=0 error="illegal 'l' character in commit message type: col=02"

file(docs/example_scripts/example.sh): Create new example script file

time=2024-11-30T09:36:54.181+01:00 level=ERROR msg="Invalid commit message" retry=1 error="illegal 'l' character in commit message type: col=02"

file(docs/example_scripts/example.sh): Initial commit of new example script

time=2024-11-30T09:36:54.850+01:00 level=ERROR msg="Invalid commit message" retry=2 error="illegal 'l' character in commit message type: col=02"
panic: illegal 'l' character in commit message type: col=02

goroutine 1 [running]:
github.com/sergiotejon/ai-commit/internal/cmd.init.func1(0x1400012a400?, {0x100faa8c1?, 0x4?, 0x100faa8c5?})
        /home/runner/work/ai-commit/ai-commit/internal/cmd/root.go:70 +0x5a0
github.com/spf13/cobra.(*Command).execute(0x1014fe4a0, {0x1400008e070, 0x0, 0x0})
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:989 +0x828
github.com/spf13/cobra.(*Command).ExecuteC(0x1014fe4a0)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1117 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1041
github.com/sergiotejon/ai-commit/internal/cmd.Execute()
        /home/runner/work/ai-commit/ai-commit/internal/cmd/root.go:110 +0x24
main.main()
        /home/runner/work/ai-commit/ai-commit/cmd/main.go:6 +0x1c

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions