lazygit/pkg
Stefan Haller 649a8b7276 Improve editing a commit
In 67b8ef449c we changed the "edit" command to insert a "break" after the
selected commit, rather than setting the selected todo to "edit". The reason for
doing this was that it now works for merge commits too.

Back then, I claimed "In most cases the behavior is exactly the same as before."
Unfortunately that's not true, there are two reasons why the previous behavior
was better (both are demonstrated by tests earlier in this branch):
- when editing the last commit of a branch in the middle of a stack of branches,
  we are now missing the update-ref todo after it, which means that amending the
  commit breaks the stack
- it breaks auto-amending (see the added test earlier in this branch for an
  explanation)

For these reasons, we are going back to the previous approach of setting the
selected commit to "edit" whenever possible, i.e. unless it's a merge commit.

The only scenario where this could still be a problem is when you have a stack
of branches, and the last commit of one of the branches in the stack is a merge
commit, and you try to edit that. In my experience with stacked branches this is
very unlikely, in almost all cases my stacked branches are linear.
2024-11-29 18:29:47 +01:00
..
app Add changeToFixup field to MoveFixupCommitDown 2024-09-15 11:19:39 +02:00
cheatsheet Initialize translation set after reading user config 2024-08-18 10:24:52 +02:00
commands Filter out merge commits when generating todo changes in InteractiveRebase 2024-11-29 18:24:00 +01:00
common Make common.UserConfig an atomic.Pointer for safe concurrent access 2024-08-18 10:24:52 +02:00
config use an unsigned_64 for DiffContextSize and add saturated add/subtract 2024-11-19 08:21:19 +11: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
fakes
gui Improve editing a commit 2024-11-29 18:29:47 +01:00
i18n pkg/gui: Allow user to select remote and branch when creating a PR 2024-11-23 11:52:21 +11:00
integration Improve editing a commit 2024-11-29 18:29:47 +01:00
jsonschema Fix boolean config keys not appearing in the generated Config.md 2024-05-31 20:07:58 +02:00
logs
snake
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 Fix ForEachLineInFile to not lose the last line if it doesn't end with a LF 2024-10-09 15:37:08 +02:00