jesseduffield.lazygit/pkg/integration/tests/interactive_rebase
Stefan Haller 1fdcc29277 Fix deleting update-ref todos
It is a bad idea to read a git-rebase-todo file, remove some update-ref todos,
and write it back out behind git's back. This will cause git to actually remove
the branches referenced by those update-ref todos when the rebase is continued.

The reason is that git remembers the refs affected by update-ref todos at the
beginning of the rebase, and remembers information about them in the file
.git/rebase-merge/update-refs. Then, whenever the user performs a "git rebase
--edit-todo" command, it updates that file based on whether update-ref todos
were added or removed by that edit. If we rewrite the git-rebase-todo file
behind git's back, this updating doesn't happen.

Fix this by not updating the git-rebase-todo file directly in this case, but
performing a "git rebase --edit-todo" command where we set ourselves as the
editor and change the file in there. This makes git update the bookkeeping
information properly.

Ideally we would use this method for all cases where we change the
git-rebase-todo file (e.g. moving todos up/down, or changing the type of a
todo); this would be cleaner because we wouldn't mess with git's private
implementation details. I tried this, but unfortunately it isn't fast enough.
Right now, moving a todo up or down takes between 1 and 2ms on my machine;
changing it to do a "git rebase --edit-todo" slows it down to over 100ms, which
is unacceptable.
2024-03-26 22:29:56 +01:00
..
advanced_interactive_rebase.go Use sentence case everywhere 2023-05-25 23:52:19 +10:00
amend_commit_with_conflict.go Insert fake todo entry for a conflicting commit that is being applied 2023-06-22 18:57:58 +02:00
amend_first_commit.go Use sentence case everywhere 2023-05-25 23:52:19 +10:00
amend_fixup_commit.go Use sentence case everywhere 2023-05-25 23:52:19 +10:00
amend_head_commit_during_rebase.go Improve prompts when amending commits 2023-09-01 18:55:16 +02:00
amend_merge.go Improve prompts when amending commits 2023-09-01 18:55:16 +02:00
amend_non_head_commit_during_rebase.go Use ErrorToast instead of error panel when invoking a disabled command 2024-01-14 17:45:35 +01:00
delete_update_ref_todo.go Fix deleting update-ref todos 2024-03-26 22:29:56 +01:00
dont_show_branch_heads_for_todo_items.go Don't show branch head on rebase todos if the rebase.updateRefs config is on 2024-03-02 10:17:58 +01:00
drop_todo_commit_with_update_ref.go Don't show branch head on rebase todos if the rebase.updateRefs config is on 2024-03-02 10:17:58 +01:00
drop_with_custom_comment_char.go Support range select in rebase actions 2024-01-23 17:23:56 +11:00
edit_first_commit.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
edit_non_todo_commit_during_rebase.go Support range select in rebase actions 2024-01-23 17:23:56 +11:00
edit_range_select_outside_rebase.go Support setting a range of commits to "edit" outside of a rebase 2024-03-09 07:43:48 +01:00
edit_the_confl_commit.go Support range select in rebase actions 2024-01-23 17:23:56 +11:00
fixup_first_commit.go Use ErrorToast instead of error panel when invoking a disabled command 2024-01-14 17:45:35 +01:00
fixup_second_commit.go Support range select in rebase actions 2024-01-23 17:23:56 +11:00
mid_rebase_range_select.go Support setting a range of commits to "edit" outside of a rebase 2024-03-09 07:43:48 +01:00
move.go Support range select in rebase actions 2024-01-23 17:23:56 +11:00
move_in_rebase.go Support range select in rebase actions 2024-01-23 17:23:56 +11:00
move_update_ref_todo.go Allow moving update-ref todos up/down 2024-03-16 22:01:03 +01:00
move_with_custom_comment_char.go Use comment char config on interactive rebase 2023-07-02 02:07:32 -03:00
outside_rebase_range_select.go Support range select in rebase actions 2024-01-23 17:23:56 +11:00
pick_rescheduled.go Add test for a pick that fails and gets rescheduled 2023-06-22 18:57:43 +02:00
quick_start.go Allow showing Disabled errors as error panel instead of toast 2024-01-14 17:45:35 +01:00
quick_start_keep_selection.go Don't show branch head on rebase todos if the rebase.updateRefs config is on 2024-03-02 10:17:58 +01:00
quick_start_keep_selection_range.go Don't show branch head on rebase todos if the rebase.updateRefs config is on 2024-03-02 10:17:58 +01:00
rebase.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
reword_commit_with_editor_and_fail.go Add test for rewording a commit and failing with an error 2023-06-22 18:57:43 +02:00
reword_first_commit.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
reword_last_commit.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
reword_you_are_here_commit.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
reword_you_are_here_commit_with_editor.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
shared.go Insert fake todo entry for a conflicting commit that is being applied 2023-06-22 18:57:58 +02:00
squash_down_first_commit.go Use ErrorToast instead of error panel when invoking a disabled command 2024-01-14 17:45:35 +01:00
squash_down_second_commit.go Support range select in rebase actions 2024-01-23 17:23:56 +11:00
squash_fixups_above.go Make it easy to create "amend!" commits 2024-03-22 08:27:45 +01:00
squash_fixups_above_first_commit.go Make it easy to create "amend!" commits 2024-03-22 08:27:45 +01:00
squash_fixups_in_current_branch.go Keep the same line selected after squashing fixup commits 2024-03-09 07:55:22 +01:00
swap_in_rebase_with_conflict.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
swap_in_rebase_with_conflict_and_edit.go Add a test for stopping at an "edit" command that conflicts 2023-06-22 18:57:58 +02:00
swap_with_conflict.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
view_files_of_todo_entries.go Don't show branch head on rebase todos if the rebase.updateRefs config is on 2024-03-02 10:17:58 +01:00