Repository navigation
Restore Previous Commit Message on Undo Last Commit - #9796
Merged
Merged
Conversation
* Added `getLog` method to `Repository`. * Added `ILogOptions` to make the method friendlier to extension. * Options include `prevCount` and `format`, to effect our use case which is `git log -1 format=%B`. * Added this to the client-server communication pipeline.
* Added line in `UndoLastCommitAction` to get the previous commit msg and store in `IStorageService`. * Added `UpdateCommitInputPrevCommitMsg` that checks for that key in storage, and use it then remove it if it exists. * This does not suffer from the previous bug that blanked out the commit msg if you unstage a file. * Added a clause if the undo last commit fails to remove the key from storage. This way, it doesn't stay in there and get used later (I was scratching my head when it showed up later).
|
Hi @bill-mybiz, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! The agreement was validated by Microsoft and real humans are currently evaluating your PR. TTYL, MSBOT; |
Author
|
I didn't see the "automagically assigned to X" thing, so I'm going to shout out to João Moreno (@joaomoreno) here. |
Contributor
|
Author
|
João Moreno (@joaomoreno) Looks beautiful. Thanks for your help. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This relates to issue #6190.
I've gone ahead and reimplemented the
getLogmethod, modeling almost exactly thegetCommitTemplatemethod along the way.I've also implemented the consuming part of this similar as before, using
IStorageService. I adjusted it to avoid the bug of blanking out the commit msg when unstaging a file. It also works for consecutive calls to "Undo Last Commit".If you think there is a better way than using
IStorageService, then it should be easy enough to change with how I separated these two commits. As it is though, it is working on my machine (Ubuntu 16.04).