Skip to content

Config option to separate or hide untracked files (addresses #35480)#80083

Merged
joaomoreno merged 2 commits intomicrosoft:masterfrom
Jakobeha:hide-untracked
Oct 25, 2019
Merged

Config option to separate or hide untracked files (addresses #35480)#80083
joaomoreno merged 2 commits intomicrosoft:masterfrom
Jakobeha:hide-untracked

Conversation

@Jakobeha
Copy link
Contributor

@Jakobeha Jakobeha commented Aug 29, 2019

This PR adds an option to the Git extension, handleUntracked, which changes how it handles untracked files. The options are:

  • withchanges: Untracked files are displayed with other changed files. My intention is that should not affect VSCode's current behavior
  • separate: Untracked files are in a separate UNTRACKED section below the CHANGES section. When staging all changes, a dialog will ask the user if they want to include untracked files or not.
  • hide: Untracked files are completely hidden from the changes list. They are also not counted in the badge (even if all is selected)

I figure this might need more work, or maybe it's not the best approach. But currently it makes it much easier to use VSCode's git capabilities for projects with a lot of untracked files.

Screen Shot

Fixes #35480

@msftclas
Copy link

msftclas commented Aug 29, 2019

CLA assistant check
All CLA requirements met.

@joaomoreno joaomoreno self-requested a review August 30, 2019 09:02
@joaomoreno joaomoreno added this to the Backlog milestone Aug 30, 2019
@joaomoreno joaomoreno added the git GIT issues label Aug 30, 2019
Copy link
Member

@joaomoreno joaomoreno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some general comments. I like the overall approach. I'm going to give it a good test drive and a final review and will try to merge it today.

"displayName": "Git",
"description": "Git SCM Integration",
"displayName": "Hide Untracked Files (Git)",
"description": "Copy of the built-in Git extension which hides untracked files",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These seem leftover changes.

.getConfiguration('git', Uri.file(repository.root))
.get<'withchanges' | 'separate' | 'hide'>('handleUntracked') ||
'withchanges';
let includeUntracked;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This misses a type.

@joaomoreno
Copy link
Member

Did a lot of cleanup:

  • Untracked decorations were missing.
  • The Stage All command was behaving strangely. If there's a separate section, we should just have a separate Stage All Untracked action which does not ask about untracked files in the normal Stage All action.
  • Same for the Discard All Changes command. The new Discard All Untracked Changes should only clean untracked files.
  • We probably also want Stage All Tracked Changes and Discard All Tracked Changes commands.
  • The smart commit action should also work differently based on the setting and just not include untracked changes, unless they are the only changes available.
  • Renamed setting to untrackedChanges
  • Renamed default option to default

@joaomoreno joaomoreno modified the milestones: Backlog, October 2019 Oct 25, 2019
@joaomoreno joaomoreno merged commit 966e3fd into microsoft:master Oct 25, 2019
@joaomoreno
Copy link
Member

Great job overall, definitely the bulk of the work! Thanks! 🍻

@Jakobeha Jakobeha deleted the hide-untracked branch October 25, 2019 17:49
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

git GIT issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Git: Hide untracked files

3 participants