Add support for git-crypt#81983
Closed
mikeseese wants to merge 1 commit into
Closed
Conversation
|
This looks like a This approach is certainly simpler whereas mine was focused more on support for a generic git filter. Regardless of whatever is thought to be best, would be nice to have git-crypt file diffs working properly! |
Contributor
Author
|
I would definitely prefer a generic solution rather than a specific one. Nice find (of this PR) @martin-css! I'll take a look at your PR |
Contributor
Author
|
Closing in favor of #81395 |
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 PR resolves #34330 by adding support for git-crypt, a tool which encrypts and decrypts files as a git filter.
Currently VS Code does not properly show diffs for files that are encrypted on the
remotebut decrypted locally.Here is some of the current behavior:
A file will have no changes (see below that
production.yamldoesn't show up in thegit statuspanel) but will show in the editor that the whole file was modified:We can see here when bringing up the inline diffs, that it's comparing the decrypted local file with the encrypted
HEADversion:Lastly, when the file is changed (shown below as showing up in the
git statuson the panel), and thegit diffis opened, the diff isn't shown because the left side is the binary version:This PR is fairly simple, and doesn't attempt to solve the total scope of adding generic support for any and all filters. However, I hope this can get accepted in the meantime before that solution is realized to support this specific issue.
This PR checks after a
git showto see if the buffer contains a magic word that indicates it is agit-cryptencrypted blob. If it is, then it runs it intogit-crypt smudgewhich will decrypt the contents appropriately. This resolves all of the cases mentioned above.A potential implementation for solving the generic issue would be to read
.gitattributesfor the file beinggit show'd and see what thefilteris and hand that as the program to execute the blob on. However, this would require significantly more testing which was out of scope for the work I'm doing.