New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git-rebase-show-commit asks to save git-rebase-todo #2770
Comments
It seems to me that this is one of those situations when you really want to save the buffer. Say you edit some file but don't save it, then you start a rebase and a conflict occurs in exactly that file? What now? You have to save your work manually in some other file, resolve the conflict, and finish the rebase. Then you have to recover the changes from the temporary file, but it might not be as simple as just copying it to the proper location and Magit won't be able to help you merging. |
Instead I would recommend that you set |
I believe there's been some miscommunication. What I meant by that was: could the file i.e. I'd rather not be prompted with |
Well, it's late here... :-) I will look at this in a few days. |
The git-rebase-todo buffer is frequently in a modified state, but there is no need to save it before showing a commit. It will be taken care of by with-editor-return when the user exits through with-editor-finish. The unsaved buffer should almost always be the git-rebase-todo because the initial 'git rebase' call will fail if there are unstaged changes. The user could unwisely go and modify some other tracked buffers after starting a rebase, and this could put things into a bad state [1], but this is unrelated to whether the user happened to call a command to show a commit. Closes #2770. [1] And, when the user has done this, I don't think there is really any good action to take to fix the situation. It's bad whether or not the buffer is saved. The user should just never start an interactive rebase and then change buffers of tracked files before triggering the rebase with with-editor-finish.
I've looked into a bit and don't think asking to save the buffer is a |
The git-rebase-todo buffer is frequently in a modified state, but there is no need to save it before showing a commit. It will be taken care of by with-editor-return when the user exits through with-editor-finish. The unsaved buffer should almost always be the git-rebase-todo because the initial 'git rebase' call will fail if there are unstaged changes. The user could unwisely go and modify some other tracked buffers after starting a rebase, and this could put things into a bad state [1], but this is unrelated to whether the user happened to call a command to show a commit. Closes #2770. [1] And, when the user has done this, I don't think there is really any good action to take to fix the situation. It's bad whether or not the buffer is saved. The user should just never start an interactive rebase and then change buffers of tracked files before triggering the rebase with with-editor-finish.
@kyleam That works for me, thanks. |
emacs -Q
magit-status
a repo and do an interactive rebase with several commitsPerhaps this is an intended safety measure in this case, but I find it more annoying than anything. However, I usually like the save prompt in other situations.
Could
git-rebase-todo
be exempt frommagit-save-repository-buffers
at least in the case ofgit-rebase-show-commit
?Magit 20160902.1451, Git 2.9.3, Emacs 25.1.3, gnu/linux
The text was updated successfully, but these errors were encountered: