Make "clear undo history" NOT drop the redo stack, just the undo stack
A simple UI change to let users manage their undo resources more effectively:
In the undo history dialog, "remove all operations" should be instead "remove prior operations" and only remove undo_stack. If there are no redo operations, this works as before. This will allow the user to free operations which will never be undone, while maintaining the future history of the redo stack.
Other UX options: Make an extra button that does this, make it a right-click action on an undo element.
I implemented this as a quick hack to app/core/gimpimage-undo.c, removing line ~249:
- gimp_undo_free (GIMP_UNDO (private->redo_stack), GIMP_UNDO_MODE_REDO);
However, other users of gimp_image_undo_free() do not expect this and it looks like this quick hack would lead to memory leaks. I looked into the semantics of "dirty" and the "freeze" and "thaw" undo actions but couldn't figure out the safe way to do it. Hoping that someone familiar with the code can do it correctly.
Please find me as Thanatos in #gimp for any chat!