Vscode: Git: Support git-crypt

Created on 13 Sep 2017  路  14Comments  路  Source: microsoft/vscode

Steps to Reproduce:

  1. Clone a repository which uses git-crypt to encrypt specific files.
  2. Make a small modification to one of the encrypted files.
  3. Attempt to view a diff using VS Code's Source Control panel.

You will see the resulting diff shows the entire encrypted file in red, and the entire unencrypted contents of the file in green, implying the entire file has changed.

When I take a look at the Git tab of the Output console, it looks like the command being used is git show HEAD:/path/to/filename which doesn't seem to play nicely with git-crypt's approach. If I try something like git diff /path/to/filename this works as expected though.

Reproduces without extensions: Yes

feature-request git help wanted

Most helpful comment

I could take a look at this issue if you don't mind.

All 14 comments

I could take a look at this issue if you don't mind.

How about support it on vac extensions?

My theory is that the commands VS Code uses to get git diffs don鈥檛 play nicely with git-crypt, which uses filters defined in a .gitattributes file to transparently decrypt/encrypt certain files in your repository.

You can see more about how git-crypt works here https://github.com/AGWA/git-crypt/blob/master/README.md

Hi again, just wanted to say that in the latest VSCode update, the behaviour has changed. Instead of showing the garbled text for 'before' and the entire file in green for 'after', the diff of a git-crypted file now just shows an error:

The file will not be displayed in the editor because it is either binary, very large or uses an unsupported text encoding.

Whilst this is better than the garbled text, it would still be really cool if VSCode could support git-crypt 鉂わ笍

It would be nice to see the difference of files. Atom for examples allows you to do that! I guess that the git filters in atom are followed...

Is this still not supported ?

Still not supported...

No promises, but I started looking into this for Hacktoberfest

Can confirm that I have a solution; I'll put in a PR today/tomorrow.

Submitted a PR: https://github.com/microsoft/vscode/pull/81983 (cc @joaomoreno)

Awesome! Thanks for taking a look at this @seesemichaelj !

For posterity's sake, there is another open PR which may resolve this issue: https://github.com/microsoft/vscode/pull/81395

@joaomoreno there are a couple of PRs open here to resolve this issue. What are the next steps to selecting one implementation to focus on and get it reviewed and approved?

I'll mark this as a dupe of the more generic https://github.com/microsoft/vscode/issues/24883

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Brakkar picture Brakkar  路  364Comments

Tyriar picture Tyriar  路  187Comments

Perkovec picture Perkovec  路  191Comments

Tekbr picture Tekbr  路  191Comments

niagr picture niagr  路  246Comments