jesseduffield.lazygit/pkg/gui/controllers
Stefan Haller 95940ee01e Ignore commit prefixes with an empty pattern
Before we changed the commitPrefix config to a list in #4261, 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 #4261 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
..
helpers Ignore commit prefixes with an empty pattern 2025-03-12 08:15:36 +01:00
attach.go Begin refactoring gui 2023-04-30 13:19:52 +10:00
base_controller.go Remove return value of Focus-related functions 2024-09-06 08:45:48 +02:00
basic_commits_controller.go Remove unnecessary type arguments 2025-03-03 21:24:49 +01:00
bisect_controller.go Remove unnecessary type arguments 2025-03-03 21:24:49 +01:00
branches_controller.go Remove unnecessary type arguments 2025-03-03 21:24:49 +01:00
command_log_controller.go Remove return value of Focus-related functions 2024-09-06 08:45:48 +02:00
commit_description_controller.go Handle pasting multi-line commit messages 2025-02-10 13:40:25 +01:00
commit_message_controller.go Handle pasting multi-line commit messages 2025-02-10 13:40:25 +01:00
commits_files_controller.go Remove unnecessary type arguments 2025-03-03 21:24:49 +01:00
common.go lots of changes 2023-04-30 13:19:53 +10:00
confirmation_controller.go Remove return value of IContextMgr.Push/Pop et. al. 2024-09-06 08:45:48 +02:00
context_lines_controller.go use an unsigned_64 for DiffContextSize and add saturated add/subtract 2024-11-19 08:21:19 +11:00
custom_patch_options_menu_action.go Remove return value of OpenCommitMessagePanel 2024-09-06 08:45:48 +02:00
diffing_menu_action.go Remove return value of Alert/Confirm/Prompt 2024-09-06 08:45:48 +02:00
files_controller.go Remove unnecessary type arguments 2025-03-03 21:24:49 +01:00
filter_controller.go Introduce filtered list view model 2023-07-03 12:54:13 +10:00
filtering_menu_action.go Remove return value of Alert/Confirm/Prompt 2024-09-06 08:45:48 +02:00
git_flow_controller.go Remove unnecessary type arguments 2025-03-03 21:24:49 +01:00
global_controller.go Disable global keybinds while popups are active 2025-02-23 08:44:48 +01:00
jump_to_side_window_controller.go Disable global keybinds while popups are active 2025-02-23 08:44:48 +01:00
list_controller.go Remove return value of IContextMgr.Push/Pop et. al. 2024-09-06 08:45:48 +02:00
list_controller_trait.go Remove ErrorMsg 2024-04-18 10:10:30 +02:00
local_commits_controller.go Use Rewording instead of Committing when rewording the head commit 2025-03-06 08:15:18 +01:00
local_commits_controller_test.go Keep the same line selected after squashing fixup commits 2024-03-09 07:55:22 +01:00
menu_controller.go Remove unnecessary type arguments 2025-03-03 21:24:49 +01:00
merge_conflicts_controller.go Remove return value of IContextMgr.Push/Pop et. al. 2024-09-06 08:45:48 +02:00
options_menu_action.go Disable KeybindingsMenu using a DisabledReason when a panel is open 2025-01-03 10:09:42 +01:00
patch_building_controller.go Adjust line number for working copy when editing a line 2025-01-07 17:46:51 +01:00
patch_explorer_controller.go Handle wrapped lines in patch explorer state 2024-12-23 12:24:09 +01:00
quit_actions.go Get rid of error return value of PostRefreshUpdate and a few related ones 2024-10-13 16:55:54 +02:00
reflog_commits_controller.go Remove unnecessary type arguments 2025-03-03 21:24:49 +01:00
remote_branches_controller.go Remove unnecessary type arguments 2025-03-03 21:24:49 +01:00
remotes_controller.go Remove unnecessary type arguments 2025-03-03 21:24:49 +01:00
rename_similarity_threshold_controller.go Remove return value of RenderToMainViews and some related functions 2024-09-06 08:45:48 +02:00
screen_mode_actions.go Standardise on 'screen mode' name 2025-01-11 14:25:48 +11:00
scroll_off_margin.go Replace min/max helpers with built-in min/max 2024-04-07 23:24:10 +08:00
scroll_off_margin_test.go Add tests for scroll-off margin of zero 2023-08-21 08:10:28 +02:00
search_controller.go Introduce filtered list view model 2023-07-03 12:54:13 +10:00
search_prompt_controller.go Enforce single-item selection in various actions 2024-01-19 10:50:49 +11:00
shell_command_action.go Remove return value of Alert/Confirm/Prompt 2024-09-06 08:45:48 +02:00
side_window_controller.go Remove return value of IContextMgr.Push/Pop et. al. 2024-09-06 08:45:48 +02:00
snake_controller.go Remove return value of IContextMgr.Push/Pop et. al. 2024-09-06 08:45:48 +02:00
staging_controller.go Disable staging and unstaging lines or hunks when the diff context size is 0 2025-02-05 16:07:22 +01:00
stash_controller.go Remove unnecessary type arguments 2025-03-03 21:24:49 +01:00
status_controller.go Use AutoRenderHyperLinks in main views 2024-09-28 12:04:51 +02:00
sub_commits_controller.go Remove unnecessary type arguments 2025-03-03 21:24:49 +01:00
submodules_controller.go Remove unnecessary type arguments 2025-03-03 21:24:49 +01:00
suggestions_controller.go Remove unnecessary type arguments 2025-03-03 21:24:49 +01:00
switch_to_diff_files_controller.go Remove return value of IContextMgr.Push/Pop et. al. 2024-09-06 08:45:48 +02:00
switch_to_sub_commits_controller.go Remove unnecessary type arguments 2025-03-03 21:24:49 +01:00
sync_controller.go Fix checking out a different branch while pushing a branch for the first time 2025-01-26 10:22:19 +01:00
tags_controller.go Remove unnecessary type arguments 2025-03-03 21:24:49 +01:00
toggle_whitespace_action.go Remove return value of Focus-related functions 2024-09-06 08:45:48 +02:00
undo_controller.go Improve undo action to restore files upon undoing a commit 2025-01-18 00:07:15 +11:00
vertical_scroll_controller.go Change direct access to Common.UserConfig to a getter 2024-08-18 10:24:52 +02:00
workspace_reset_controller.go Bump gocui and adapt lazygit code 2024-12-01 10:40:08 +01:00
worktree_options_controller.go Remove unnecessary type arguments 2025-03-03 21:24:49 +01:00
worktrees_controller.go Remove unnecessary type arguments 2025-03-03 21:24:49 +01:00