jesseduffield/lazygit

`commitPrefix` options doesn't work

Opened this issue · 3 comments

Describe the bug
commitPrefix option simply doesn't work. However if I replace it with commitPrefixes with same options as first one, then it works.

This works

git:
  commitPrefixes:
    my_project:
      pattern: "^\\w+\\/(\\w+-\\w+).*"
      replace: "[$1] "

This doesn't

git:
  commitPrefix:
      pattern: "^\\w+\\/(\\w+-\\w+).*"
      replace: "[$1] "

To Reproduce
Steps to reproduce the behavior:

  1. Go to your config file, .config/lazygit/config.yml in my case
  2. Paste and save
git:
  commitPrefix:
      pattern: "^\\w+\\/(\\w+-\\w+).*"
      replace: "[$1] "
  1. Restart lazygit
  2. Try to commit and see no prefix

Expected behavior
Prefix is present in commit message

Version info:
Run lazygit --version and paste the result here commit=, build date=, build source=homebrew, version=0.40.2, os=darwin, arch=arm64, git version=2.39.3 (Apple Git-145)
Run git --version and paste the result here git version 2.39.3 (Apple Git-145)

This is not released yet. You'll have to build from master to get it.

Oh, I get it. Maybe point that out in docs? LIke 👇

Warning

This feature is not yet in production. You have to manually build from master to get it.

However if I replace it with commitPrefixes with same options as first one, then it works.

For me commitPrefixes only seems to work for the branch that I was on when starting lazygit. Once I switch branches within lazygit, I still end up with the prefix that corresponds to that "initial" branch