mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-08 04:04:22 +02:00
cd50c79ae4
There are two possible fixes for this bug, and they differ in behavior when rewording a commit. The one I chose here always splits at the first line feed, which means that for an improperly formatted commit message such as this one: This is a very long multi-line subject, which you shouldn't really use in git. And this is the body (we call it "description" in lazygit). we split after the first line instead of after the first paragraph. This is arguably not what the original author meant, but splitting after the first paragraph doesn't really work well in lazygit, because we would try to put both lines into the one-line subject field of the message panel, and you'd only see the second and not even know that there are more. The other potential fix would have been to join subject and description with two line feeds instead of one in JoinCommitMessageAndDescription; this would have fixed our bug in the same way, but would result in splitting the above message after the second line instead of the first. I think that's worse, so I decided for the first fix. While we're at it, simplify the code a little bit; strings.Cut is documented to return (s, "") when the separator is not found, so there's no need to do this on our side. We do have to trim spaces on the description now, to support the regular reword case where subject and body are separated by a blank line. |
||
---|---|---|
.. | ||
helpers | ||
attach.go | ||
base_controller.go | ||
basic_commits_controller.go | ||
bisect_controller.go | ||
branches_controller.go | ||
command_log_controller.go | ||
commit_description_controller.go | ||
commit_message_controller.go | ||
commits_files_controller.go | ||
common.go | ||
confirmation_controller.go | ||
context_lines_controller.go | ||
custom_command_action.go | ||
custom_patch_options_menu_action.go | ||
diffing_menu_action.go | ||
files_controller.go | ||
files_remove_controller.go | ||
filter_controller.go | ||
filtering_menu_action.go | ||
git_flow_controller.go | ||
global_controller.go | ||
jump_to_side_window_controller.go | ||
list_controller.go | ||
local_commits_controller.go | ||
menu_controller.go | ||
merge_conflicts_controller.go | ||
options_menu_action.go | ||
patch_building_controller.go | ||
patch_explorer_controller.go | ||
quit_actions.go | ||
reflog_commits_controller.go | ||
remote_branches_controller.go | ||
remotes_controller.go | ||
screen_mode_actions.go | ||
scroll_off_margin_test.go | ||
scroll_off_margin.go | ||
search_controller.go | ||
search_prompt_controller.go | ||
side_window_controller.go | ||
snake_controller.go | ||
staging_controller.go | ||
stash_controller.go | ||
status_controller.go | ||
sub_commits_controller.go | ||
submodules_controller.go | ||
suggestions_controller.go | ||
switch_to_diff_files_controller.go | ||
switch_to_sub_commits_controller.go | ||
sync_controller.go | ||
tags_controller.go | ||
toggle_whitespace_action.go | ||
types.go | ||
undo_controller.go | ||
vertical_scroll_controller.go | ||
workspace_reset_controller.go | ||
worktree_options_controller.go | ||
worktrees_controller.go |