stash: partial stash specific files#1
Merged
zawata merged 6 commits intoAxosoft:libgit-nextfrom Jul 28, 2022
Merged
Conversation
we want to build a partial stash from an index in the future, so some functions have been reworked to allow for this
code has been moved from `git_stash_save` into `git_stash_save_with_opts` in order to handle cases where we want to partially stash using options or stash normally without partially stashed paths specified
AlexaXs
approved these changes
Jul 27, 2022
AlexaXs
left a comment
There was a problem hiding this comment.
Reviewed and changes are ok. We couldn't get a review on time from the main libgit2/libgit2 maintainer, which would've been nice regarding the new function added to the API, but as far as I have checked and tested the code here, it looks good.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
See: nodegit#10
Copy-pasted from the nodegit repo which was copy pasted from the libgit2 repo:
There's this concept called partial stashing in Git where users are able to stash desired files without having to stash and also reset the entire workdir. I based my implementation on tiennou's suggestion from libgit2#4725. This introduces options to git_stash_save where developers are able to supply the paths that they want to have stashed from the workdir. I could have gone further and have exposed a git_index* option as tiennou suggested, but I chose not to at this moment. Let me know if I should expose a git_index* option so that users can supply an arbitrary index to be stashed.
I also introduced GIT_STASH_KEEP_ALL, which prevents resetting the index and workdir once a stash has been completed.