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

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

Merged
merged 2 commits into from Oct 25, 2019

Conversation

@Jakobeha
Copy link
Contributor

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

Jakobeha added 2 commits Aug 29, 2019
@msftclas

This comment has been minimized.

Copy link

msftclas commented Aug 29, 2019

CLA assistant check
All CLA requirements met.

@joaomoreno joaomoreno self-requested a review Aug 30, 2019
@joaomoreno joaomoreno added this to the Backlog milestone Aug 30, 2019
@joaomoreno joaomoreno added the git label Aug 30, 2019
Copy link
Member

joaomoreno left a comment

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",

This comment has been minimized.

Copy link
@joaomoreno

joaomoreno Oct 25, 2019

Member

These seem leftover changes.

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

This comment has been minimized.

Copy link
@joaomoreno

joaomoreno Oct 25, 2019

Member

This misses a type.

@joaomoreno

This comment has been minimized.

Copy link
Member

joaomoreno commented Oct 25, 2019

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
2 checks passed
2 checks passed
VS Code #20190829.101 succeeded
Details
license/cla All CLA requirements met.
Details
@joaomoreno

This comment has been minimized.

Copy link
Member

joaomoreno commented Oct 25, 2019

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

@Jakobeha Jakobeha deleted the Jakobeha:hide-untracked branch Oct 25, 2019
@joaomoreno joaomoreno referenced this pull request Oct 28, 2019
2 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.