lazygit/pkg
Stefan Haller 95940ee01e Ignore commit prefixes with an empty pattern
Before we changed the commitPrefix config to a list in , we had this bug
where the defaults section in Config.md would erroneously list the default for
commitPrefix as

  git:
    commitPrefix:
      pattern: ""
      replace: ""

This was not correct, commitPrefix was a pointer, and the default for that was
nil, which is not the same.

Now, some people copied and pasted the entire defaults section into their config
files, setting the commitPrefix to an empty pattern (which is not the same as
not setting it at all). And this caused the branch name to be filled in to the
subject field for every commit; see for example
https://github.com/jesseduffield/lazygit/discussions/3632.

New users copying the defaults section into their config file in the current
version no longer have this problem because now that commitPrefix is a list, it
is no longer included in the defaults section. However, the migration that we
added in  would happily carry over those empty strings into a list entry,
so people migrating from an older version still have the broken config in their
config files.

To work around the issue, ignore commit prefix settings whose pattern is an
empty string. I can't imagine a valid reason why people would actually want to
set the pattern to an empty string, so I assume this only comes from the broken
defaults problem described above.
2025-03-12 08:15:36 +01:00
..
app Add screen-mode command line argument 2025-01-02 16:01:48 +11:00
cheatsheet Update to go 1.24 2025-03-08 14:53:54 -05:00
commands URL encode gitlab brackets to make consistent with branch names 2025-03-12 09:04:04 +11:00
common Make common.UserConfig an atomic.Pointer for safe concurrent access 2024-08-18 10:24:52 +02:00
config Add acme editor preset 2025-03-06 15:02:53 +01:00
constants Make the links in the status panel point to the current version rather than master 2024-03-22 08:13:59 +01:00
env Support bare worktrees where worktree does not have its own .git file 2023-08-07 22:40:53 +10:00
fakes cleanup integration test code 2023-02-26 12:54:13 +11:00
gui Ignore commit prefixes with an empty pattern 2025-03-12 08:15:36 +01:00
i18n Use a WithWaitingStatus for rewording a non-head commit 2025-03-06 08:15:18 +01:00
integration Add an integration test for a config with a negative refspec 2025-03-11 08:33:41 +01:00
jsonschema Remove obsolete filtering from setComment 2025-02-25 11:42:47 +01:00
logs Remove secureexec package 2023-07-30 19:59:51 +10:00
snake integrate snake game into lazygit 2022-12-30 12:18:59 +11:00
tasks Suppress error logs when killing process on Windows 2025-02-15 14:51:35 +11:00
theme Highlight inactive selection in bold 2024-06-23 14:43:13 +02:00
updates Change direct access to Common.UserConfig to a getter 2024-08-18 10:24:52 +02:00
utils Migrate to only doing marshalling twice, and compare via deep copy 2025-02-27 17:05:31 -05:00