I'm talking about hide untracked files from here, or put them in other group..
The same situation in some IDE (You know the name..)
I agree that this would be a nice improvement. It makes sense that currently tracked files at least would sort to the top with untracked below. That would be enough for me at least.
This was annoying me a bit as well, you can remove the path sorting pretty easily until (or if) this get gets fixed:
diff --git a/src/vs/workbench/api/node/extHostSCM.ts b/src/vs/workbench/api/node/extHostSCM.ts
index 7ffe2da782..8313c66377 100644
--- a/src/vs/workbench/api/node/extHostSCM.ts
+++ b/src/vs/workbench/api/node/extHostSCM.ts
@@ -91,11 +91,7 @@ function compareResourceStatesDecorations(a: vscode.SourceControlResourceDecorat
}
function compareResourceStates(a: vscode.SourceControlResourceState, b: vscode.SourceControlResourceState): number {
- let result = comparePaths(a.resourceUri.fsPath, b.resourceUri.fsPath);
-
- if (result !== 0) {
- return result;
- }
+ let result = 0;
if (a.decorations && b.decorations) {
result = compareResourceStatesDecorations(a.decorations, b.decorations);
Edit - deleted files were still under untracked. To sort untracked to the bottom:
diff --git a/src/vs/workbench/api/node/extHostSCM.ts b/src/vs/workbench/api/node/extHostSCM.ts
index 7ffe2da782..363eaccecc 100644
--- a/src/vs/workbench/api/node/extHostSCM.ts
+++ b/src/vs/workbench/api/node/extHostSCM.ts
@@ -48,6 +48,9 @@ function compareResourceThemableDecorations(a: vscode.SourceControlResourceThema
function compareResourceStatesDecorations(a: vscode.SourceControlResourceDecorations, b: vscode.SourceControlResourceDecorations): number {
let result = 0;
+ if (a.letter !== b.letter && (a.letter === 'U' || b.letter === 'U')) {
+ return a.letter === 'U' ? 1 : -1;
+ }
if (a.strikeThrough !== b.strikeThrough) {
return a.strikeThrough ? 1 : -1;
@@ -91,11 +94,7 @@ function compareResourceStatesDecorations(a: vscode.SourceControlResourceDecorat
}
function compareResourceStates(a: vscode.SourceControlResourceState, b: vscode.SourceControlResourceState): number {
- let result = comparePaths(a.resourceUri.fsPath, b.resourceUri.fsPath);
-
- if (result !== 0) {
- return result;
- }
+ let result = 0;
if (a.decorations && b.decorations) {
result = compareResourceStatesDecorations(a.decorations, b.decorations);
馃憤 I often have a bunch of untracked files, and it's unnecessarily hard to see which files have changed. All the "U" files in the source control pane seem unnecessary, now that they also appear in the file explorer anyway.
for git I set up .gitignore and the U (untracked) sign in vscode disappears.
@Dari-K Would you submit a Pull Request with that change? I can implement that on my home computer but my workplace is not so open.
this would definitely be helpful fix!
@laoshaw you obviously do not generate any code then 馃槃
.gitignore can only get me so far. We produce cql files as part of the build too, and often MD files are part of the output of automation scripts.
"git.decorations.enabled": false - Removed "Untracked" status against any file.
@MaddyDahiya that did not help. It just removes the graphics decoration around the status icon, i.e.:
vs
If we omit the untracked files, what would you expect would happen if the user presses Stage All Changes
? Should the _invisible_ untracked files be staged?
@joaomoreno I don't think the untracked files necessarily need to be hidden, would be nice if they were in separate sections like in the picture the issue creator posted. Tracked vs untracked with tracked on top.
I agree. I would like to see them in a separate section, as you would see them if you ran git status
from the terminal.
I would also like to see untracked files collapsed to the level of granularity that is untracked. If an entire directory is untracked, it would be great if I only saw the directory in the same way git displays it from the terminal.
Want to create repo and add just one file from legacy codebase and expect vscode chow me just 1 file in changes list after git init; git add somefile
.
But vscode shows me 5k files in changes list. It is very inconveniently.
Hi I agree with @boochamoocha. I have set a virtualenv with 4k files and they are all listed in changes, even if I put my env folder in .gitignore . This is very annoying. How would you guys works with virtualenv, git and vscode ? I'm very new to all of this.
This feature would be great - at the moment vscode's ability to surgically stage files becomes mostly unusable in legacy projects if the project dynamically creates files when being run - it essentially forces devs to use the git command line in these instances.
Maybe just something to show files in a collapsible tree would be a quick fix.
git has its own setting to control behavior with respect to untracked files. When it is set to no in ~/.gitconfig or .git/config, vscode should respect it. That means no file which is untracked should show up in the changed list, and commit all should not commit such files.
git has its own setting to control behavior with respect to untracked files. When it is set to no in ~/.gitconfig or .git/config, vscode should respect it. That means no file which is untracked should show up in the changed list, and commit all should not commit such files.
I did what you said but it doesn't work, git status not show untracked files but vscode still show and count a bunch of untracked files.
Sorry @lehoanganh298 -- I did not mean to imply that it _does_ work that way, only to suggest that it _should be fixed_ to work that way.
I just tried whast @aperomsik suggested, adding
*.o
*.pyc
to my project .gitignore and VSCode seems to respect it.
@kousu if that works for you, great, but it's not what I suggested. The point of the settings I mentioned is to remove the need to mess with .gitignore.
I'd like to see them in a separate group and also not incrementing the git decorator changes count.
As an anonymous user and complete newbie to vscode, I can provide the following feedback. I was really un-nerved when I opened vscode for the first time, and found over 200 'changes' to my repo, which were really just un-tracked files. The only two options at the top of the 'git' tab are to 'Discard all changes' (i.e. DELETE all of my local files, which is a huge issue pissing a lot of people off - do a search for 'vscode deleted all my files' to get a sense for it) and 'stage all changes'. Well, I don't want to do either. I want vscode to IGNORE all these untracked local files. Why isn't that the default option??? or an option at all? Even just a way to update .gitignore through vsc would be ok. Thank you!
If there are many untracked changes under a folder, i'd like to see that automatically collapsed under one entry. For example, in the CLI, it looks like this,
But in vscode, it shows an entry for every file.
This one issue essentially prevents me from using the Source Control tab of VSCode. I work with a Joomla site and do not check in any of the Joomla core files into my GIT repo. VSCode consistently tells me I have over 5000 changed files. Not helpful.
Consequently, I use SourceTree instead. I'd love to have one less tool to rely on though.
Agree with johnrix. My project shows 184 changes, but only about 2% of those are modified.
same here; +1 for having an option to ignore untracked files - and ideally for it to be the default
@joaomoreno Can you please push it up, with @Dari-K suggestion?
@eladcandroid maybe the team is reluctant to hide untracked, because then how would you add a new file to the repo? So would it be a good idea to adapt a bit the name to 'hide/separate untracked files'? Because the separation is also a solution, though they are not hidden.
IMHO, having the files grouped into collapsible sections, last of them being 'untracked' - that I for one would have collapsed like 99.99% of the time - would already be huge improvement towards unclobbering the display
I don't care having to add new files by other means like the command line, sourcetree, or whatever other tool
It's not as if the vscode extension was supporting 100% of the daily needs anyway; don't get me wrong, it is really cool to have it do what it currently does as a basic toolset - esp. for teaching btw !
I think grouped and folding is a good choice, but it should be hidden ("+ more") if more than 50 or 100 files, and provide a button to expand (not recommended) or pop up a window (possibly increased development costs) to filter, select and manipulate files.
+1 It would be very helpful for us recovering CLI users if VSCode would just mimic the way ordinary git commands work, i.e. git status
shows staged, unstaged and untracked files separately. Possible improvements: support an analog of git status -uno
(don't show untracked files); support git add -u
(stage changes to the tracked files only).
Same here, :+1: for the collapsible sections idea. It's already used for a variety of other groupings in Visual Studio!
+1. This would be very helpful to all.
+1, please implement this!
+1 !
+1
Not sure if it was mentioned -- Visual Studio Code DOES honour the .gitignore file, so feel free to add untracked files there to clean up the source control view. Of filter out a whole folder, and put all untracked files there.
@nonarkitten not sure about others, but I need the functionality outside of the gitignore, as the gitignore for my repo is tracked and I can't modify it.
@bonfire62 Create a folder. Put everything untracked in there. Add a new .gitignore in there and have it ignore everything. Git will automatically never include empty folders.
@nonarkitten The whole reason I set status.showuntrackedfiles to no in .gitconfig was to avoid the need to mess with gitignore. In any case, any workaround which imposes new folder structure restrictions is just not worth it.
@nonarkitten That wouldn't work in my case, because a lot of the content I need to hide as untracked is generated at compile time
+10 on this. Command line git status
shows unstaged files first, so I can see changes easily. VSCode on the other hand combines unstaged and untracked files in a single list, which is too long to be useful.
I don't know about others, but at least in my project directory, untracked files come and go. Adding every single one of them to .gitignore
is not a workable solution.
For me, the .gitignore approach is helpful as far as being able to ignore entire folders that are not tracked and it brings the change list down to a somewhat more manageable size, but its not a complete solution for many of the reasons expressed above.
Everybody: give it up for @Jakobeha, his PR just landed in master and it addresses your pains. :fireworks:
A new setting Git: Untracked Changes
allows you to separate or hide away untracked changes. Give it a spin next monday on Insiders!
Looks like options there to suit most needs from what I can see. Nice work @Jakobeha!
@Jakobeha @joaomoreno
Just saw that on VSCode 1.40! Thank you so much! You rock! 馃幐馃槑
Fantastic! Inspired me to install Insiders!
Simply fantastic. Thanks.
Been using the git integration a good bit of late, thanks to this update. :-)
Most helpful comment
Everybody: give it up for @Jakobeha, his PR just landed in master and it addresses your pains. :fireworks:
A new setting
Git: Untracked Changes
allows you to separate or hide away untracked changes. Give it a spin next monday on Insiders!