-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Support Grebase --continue/--edit-todo editor invocation #1139
Conversation
On a rebase instruction that should result in an immediate commit, the quickfix list will be closed and Gcommit will be called.
I've done some more testing and the code that adds informational rebase messages to the quickfix causes the commit window not to open. I'm pushing up a fix momentarily that updates the code which checks that there are no errors in the quickfix list by excluding informational lines. |
This will result in a "problem with editor false" style error in the quickfix list on |
I'll deal with that later. |
edit: whoops, didn't see your latest message. Glad it's in. It will result in that error in the quickfix list, but the quickfix list will not be opened. However, we can avoid that error by simply changing the editor "true" rather than "false" when "--edit-todo" is passed in. I'm pushing that up now. I am not entirely sure if this is the approach you were thinking of, but it preserves error checking by running the Also, I want to make sure you know that the same behaviour will happen on "--continue". The editor error will be in the quickfix window, but the quickfix window will not automatically open if there is a commit message to edit. Causing an error using |
Yeah the error format should filter out the false message now that I think about it, but I don't see any reason to clobber the quickfix list at all in the successful |
Any thoughts on how we might make |
I'll have to look into it more |
|
It's driving me nuts. If someone can figure out the conditions of when we need to call |
Rebase detects unresolved conflicts by looking for unstaged changes. Even if you are not in the middle of a merge conflict resolution, it will complain that you are if you have unstaged files. Similarly, if you have any staged files and you run Minor note: if there are conflicts on |
My last post was correct but I have actually confirmed it in the source code now. There is only one minor special case to consider. The main points about how it works are below, but more information is available here if you need to dig into it:
Main takeaways:
I hope there's something in there to help implement this. It's certainly beyond my capabilities to actually add this behaviour to the plugin without some serious investment. |
I can't imagine I covered every use case but it's now working for the ones I bothered to test. |
As discussed in #797
copen
was decided as the method of feedback for the user onGrebase --continue
becausecwindow
obfuscates user feedback.The exact method for
--edit-todo
discussed was not used. You don't need to copy the file, edit it, and move it back. You just need to edit the file. The only difference between this and invoking--edit-todo
via the command line is that the commit hashes are not contracted and expanded. This requires usinggit rebase--interactive --expand-ids
andgit rebase--interactive --shorten-ids
, which are internal helpers and can't be relied on to remain publicly accessible.Grebase --edit-todo
does not yet support window mods but it easily can. Let me know if you think this is needed now.I also believe that it would be useful to have
--continue
and--edit-todo
rebase autocompletion. This is another thing that can easily be added if you think it should be part of this PR.