Skip to content
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

gitDecoration.ignoredResourceForeground Theme Bug #37857

Closed
johndugan opened this issue Nov 9, 2017 · 26 comments
Closed

gitDecoration.ignoredResourceForeground Theme Bug #37857

johndugan opened this issue Nov 9, 2017 · 26 comments
Assignees
Labels
candidate Issue identified as probable candidate for fixing in the next release file-decorations git GIT issues verified Verification succeeded

Comments

@johndugan
Copy link

  • VSCode Version: Code 1.18.0 (dcee220, 2017-11-08T21:22:49.932Z)
  • OS Version: Windows_NT x64 10.0.15063
  • Extensions:
Extension Author (truncated) Version
project-manager ale 0.23.0
vscode-eslint dba 1.4.3
githistory don 0.2.3
vscode-npm-script eg2 0.3.3
mssql ms- 1.2.1
debugger-for-chrome msj 3.5.0
vetur oct 0.11.0
code-settings-sync Sha 2.8.5
guides spy 0.9.0

(1 theme extensions excluded)


Hi Folks,

On the back of your great 1.18 release, I have been updating Contrast Theme with the new gitDecoration.* properties. I don't believe gitDecoration.ignoredResourceForeground works. All the others work just fine.

Reproduces without extensions: Yes/No

@vscodebot vscodebot bot added the extensions Issues concerning extensions label Nov 9, 2017
@jrieken jrieken added file-decorations git GIT issues info-needed Issue requires more information from poster and removed extensions Issues concerning extensions labels Nov 9, 2017
@jrieken
Copy link
Member

jrieken commented Nov 9, 2017

I don't believe gitDecoration.ignoredResourceForeground works. All the others work just fine.

What do you mean by that? Does it not pick up customisations, do file never show as ignore for you? Check the screenshot below in which ignored folder (node_modules, out) are grey'ish

screen shot 2017-11-09 at 08 59 09

@vvs
Copy link

vvs commented Nov 9, 2017

It doesn't work for me on the latest insiders:

  • VSCode Version: Code - Insiders 1.19.0-insider (0fbdfff, 2017-11-09T08:13:46.054Z)
  • OS Version: Windows_NT x64 10.0.16299

Basically, when I modify the .gitignore file and add, say, build.gradle file to the ignore list, the build.gradle file stays as-is, the decoration is not modified in any way and the file doesn't seem to be any different as compared to its siblings.

@vvs
Copy link

vvs commented Nov 9, 2017

Also, the node_modules folder that was in the .gitignore from the start is not grayed out.

@vvs
Copy link

vvs commented Nov 9, 2017

One more example:

  1. Create IGNORE file.
  2. It is correctly shown in green.
  3. Add IGNORE to the .gitignore
  4. The green color decoration and the U label are gone, which hints to the fact that VS Code correctly understands that the file is to be ignored. BUT:
  5. The newly ignored file looks just like any other regular file, no special coloring. gitDecoration.ignoredResourceForeground doesn't have any effect on it.

@jrieken
Copy link
Member

jrieken commented Nov 9, 2017

Basically, when I modify the .gitignore file and add, say, build.gradle file to the ignore list, the build.gradle file stays as-is

When a file is already tracked by git, adding it to .gitignore is not doing anything. Check with git check-ignore <path> or git status --ignored. This explains how to ignore a tracked file: https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore

@jrieken
Copy link
Member

jrieken commented Nov 9, 2017

re #37857 (comment) @vvs What am I missing? (I did tweak the ignored color to be quite strong here)

nov-09-2017 12-05-58

@vvs
Copy link

vvs commented Nov 9, 2017

When a file is already tracked by git, adding it to .gitignore is not doing anything.

Yeah, that was a bad example, so I posted a better one :)

What am I missing?

You don't seem to be missing anything, everything works fine on your side. :) The question is what am I missing, since it doesn't work for me. Nothing in the console logs either. With modified settings and without modified settings, it doesn't matter.

I tried to remove the theme settings, the color customizations, still not working. Tried to disable all extensions, no change. Basically, no matter what I do I wasn't able to actually color the ignored files...

@jrieken
Copy link
Member

jrieken commented Nov 9, 2017

Can you check with the Git output (Git: Show Git Output)? It should print invocation of the git check-ignore commands. Also try to run those manually on the command line

@vvs
Copy link

vvs commented Nov 9, 2017

Yes, I see the git check-ignore command, followed by a rather HUGE list of files and directories (not sure how those are calculated, but they seem to be somewhat related to the opened files I have).

When I run the same command in the console, I see, among other things, the following:

"w:\\FULL\\PATH\\TO\\IGNORE"

The VS Code correctly handles the IGNORE file as ignored, and it is not shown in the source control tab. The only part missing is the actual coloring of the file, for some reason.

@uncleramsay
Copy link

If it helps at all, I'm having the exact same problem as @vvs. I've deleted all my custom settings in case one of those was conflicting, but I still get the same behaviour.

@MrCroft
Copy link

MrCroft commented Nov 9, 2017

Hmmm... What I get in Git output (on the small repo I've initialized just to test this) is not consistent:
Most times I get:

Using git 2.14.1.windows.1 from C:\Program Files\Git\cmd\git.exe
git rev-parse --show-toplevel
git config --get commit.template
git status -z -u
git symbolic-ref --short HEAD
git rev-parse master
git rev-parse --symbolic-full-name --abbrev-ref master@{u}
fatal: no upstream configured for branch 'master'

git for-each-ref --format %(refname) %(objectname)
git remote --verbose
git show :.gitignore
git check-ignore c:\wamp64\www\git-test\.gitignore c:\wamp64\www\git-test\untracked.txt c:\wamp64\www\git-test\modified.txt c:\wamp64\www\git-test\ignored.txt c:\wamp64\www\git-test\commited.txt

But sometimes I've also got on one of the output lines:
fatal: Not a git repository (or any of the parent directories): .git on the same repository for which I've pasted the above output.

But even on repos that have an origin and for which I get no such errors (no matter how many times I check the git output), the ignored color still doesn't work.
image

P.S. The ignored.txt file was never tracked. I've just created it and added it to .gitignore.

@jrieken
Copy link
Member

jrieken commented Nov 9, 2017

re #37857 (comment) @vss Maybe a casing issue... Can you open the file and copy&paste its path (from the explorer or tab title) and compare with the check-ignore-command?

re #37857 (comment) only check-ignore commands are important here...

/cc @joaomoreno

@vvs
Copy link

vvs commented Nov 9, 2017

@jrieken I've created a brand-new repository, that contains only .gitignore (checked-in) and test.txt (newly created, not committed to git).

Here's what I see in the git log:

git check-ignore w:\test-ignore\test.txt w:\test-ignore\.gitignore w:\test-ignore\.vscode\bookmarks.json w:\test-ignore\test w:\test-ignore\.vscode

And here's what I see when I copy-paste that command in the console:

git check-ignore w:\test-ignore\test.txt w:\test-ignore\.gitignore w:\test-ignore\.vscode\bookmarks.json w:\test-ignore\test w:\test-ignore\.vscode

"w:\\test-ignore\\test.txt"

This doesn't seem to be case-related.

@jrieken
Copy link
Member

jrieken commented Nov 9, 2017

"w:\\test-ignore\\test.txt"

Like that? Including the quotes and double backslashes? Or is that just a console artefact?

@vvs
Copy link

vvs commented Nov 9, 2017

Exactly like that, with quotes and everything.

@jrieken
Copy link
Member

jrieken commented Nov 10, 2017

Great, now we are talking... Can you try with the -z parameter, so echo mypath | git check-ignore -z --stdin? That should produce machine readable names with extra escaping...

@jrieken
Copy link
Member

jrieken commented Nov 10, 2017

@vvs I have also pushed a change to master that uses -z and --stdin when checking for ignored files. Please give it a try. Thanks

@vvs
Copy link

vvs commented Nov 10, 2017

@jrieken Things are getting weirder and weirder. I don't think the your changes made it into insiders build yet, so I've built the VS Code from sources myself to try it out, and I see that -z --stdin parameters are used in the git log.

Furthermore, I see that the files are properly ignored and colored (!!!) for the small test projects I created to test the problem.

But my main (big) project is still not fixed for some reason. I'll wait for the official insiders build to try it there and report back with the weird behaviors I see (I am hesitant to report them now, since that could be caused by my custom build).

@jrieken
Copy link
Member

jrieken commented Nov 10, 2017

I don't think the your changes made it into insiders build yet

Yeah, I have missed the insider-train by 2 hours... It's good to know my change made this a little better...

@jrieken jrieken added the candidate Issue identified as probable candidate for fixing in the next release label Nov 10, 2017
@jrieken
Copy link
Member

jrieken commented Nov 13, 2017

@vvs Can you try with latest insiders please?

@MrCroft
Copy link

MrCroft commented Nov 13, 2017

@jrieken It works now, even for me 😄
Just tested on 1.19.0-insider (2017-11-13)

Thank you!

@vvs
Copy link

vvs commented Nov 13, 2017

Hmm, the latest insiders is completely broken for me, does not provide ANY git functionality anymore.

In the log I see:

[Extension Host] Error: Git installation not found.
	at first.then.then (w:\Soft\VS Code\resources\app\extensions\git\out\git.js:96:42)
	at <anonymous>

The git in command line is naturally fine and works exactly like it worked yesterday.

  • VSCode Version: Code - Insiders 1.19.0-insider (73830a3, 2017-11-13T15:41:17.934Z)
  • OS Version: Windows_NT x64 10.0.16299
  • Extensions: Extensions are disabled

P.S. I am going to reinstall VS Code and see if it helps...

@vvs
Copy link

vvs commented Nov 13, 2017

I've filed the git breakage in the separate issue (#38244). Once it is fixed, I could try to verify the fix for this issue.

@vvs
Copy link

vvs commented Nov 13, 2017

@jrieken I am happy to report that your fix has indeed fixed this problem with inability to color the ignored files, it all works as expected now (will, with the workaround for the #38244, but it is unrelated to this issue).

Thank you!

@jrieken
Copy link
Member

jrieken commented Nov 14, 2017

@vvs re #37857 (comment) That cannot be related to this change...

@jrieken
Copy link
Member

jrieken commented Nov 14, 2017

Have cherry-picked the changes for the 1.18.1

@jrieken jrieken closed this as completed Nov 14, 2017
@jrieken jrieken added this to the October Recovery 2017 milestone Nov 14, 2017
@jrieken jrieken removed the info-needed Issue requires more information from poster label Nov 15, 2017
@octref octref added the verified Verification succeeded label Nov 16, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
candidate Issue identified as probable candidate for fixing in the next release file-decorations git GIT issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants