jesseduffield.lazygit/pkg
Stefan Haller 3a30211099 Don't preserve commit message when it's unchanged from initial message
Sometimes we populate the commit message panel with a pre-created commit
message. The two cases where this happens is:
- you type `w` to commit, in which case we put the skipHookPrefix in the subject
- you have a commitPrefix pattern, in which case we match it against the branch
  name and populate the subject with the replacement string if it matches

In either case, if you have a preserved commit message, we use that.

Now, when you use either of these and then cancel, we preserve that initial,
unchanged message and reuse it the next time you commit. This has two problems:
it strips spaces, which is a problem for the commitPrefix patterns, which often
end with a space. And also, when you change your config to experiment with
commitPrefix patterns, the change seemingly doesn't take effect, which can be
very confusing.

To fix both of these problems, only preserve the commit message when it is not
identical to the initial message.
2024-12-23 12:28:52 +01:00
..
app Fix moving a commit across a branch boundary in a stack 2024-12-23 12:18:48 +01:00
cheatsheet Initialize translation set after reading user config 2024-08-18 10:24:52 +02:00
commands Fix moving a commit across a branch boundary in a stack 2024-12-23 12:18:48 +01:00
common Make common.UserConfig an atomic.Pointer for safe concurrent access 2024-08-18 10:24:52 +02:00
config Add user config to enable line wrapping in the staging view 2024-12-23 12:24:09 +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 Don't preserve commit message when it's unchanged from initial message 2024-12-23 12:28:52 +01:00
i18n Allow deleting a merge commit 2024-12-23 12:12:45 +01:00
integration Don't preserve commit message when it's unchanged from initial message 2024-12-23 12:28:52 +01:00
jsonschema Let schema/config.json end with a line feed 2024-11-30 15:03:29 +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 Use ScanLinesAndTruncateWhenLongerThanBuffer instead of bufio.ScanLines 2024-05-15 13:27:01 +02: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 Return arrays with line indices from WrapViewLinesToWidth 2024-12-23 12:24:09 +01:00