Skip to content

Changing autofetch to a string config which has "current", "all" and - #111090

Merged
Eric Amodio (eamodio) merged 5 commits into
microsoft:masterfrom
jasonwilliams:autoFetchAll
Dec 11, 2020
Merged

Eric Amodio (eamodio) merged 5 commits into
microsoft:masterfrom
jasonwilliams:autoFetchAll

Conversation

@jasonwilliams

Copy link
Copy Markdown
Contributor

Changing autofetch to a string config which has "current", "all" and "off".
This allows users to fetch from all remotes instead of just their origin.
For developers working on a Fork, this should make extensions work more intuitively.

This PR fixes #110811

@jasonwilliams

Jason Williams (jasonwilliams) commented Dec 5, 2020 •

Copy link
Copy Markdown
Contributor Author

Eric Amodio (@eamodio) is this the sort of change you was expecting?
I’m happy to make changes

Can we get away with making fetchAll the default?

@eamodio

Copy link
Copy Markdown
Contributor

Jason Williams (@jasonwilliams) Thanks for taking a shot at this! Although, I meant to change git.autofetch to be a boolean | 'all', so in the json it would be like:

"git.autofetch": {
  "anyOf": [
    {
      "type": "boolean"
    },
    {
      "type": "string",
        "enum": [
          "all"
        ]
    }
  ],
  "scope": "resource",
  "description": "%config.autofetch%",
  "default": false,
  "tags": [
    "usesOnlineServices"
  ]
},

So that way any existing value will continue to work and we can additionally set the all value.

@jasonwilliams

Copy link
Copy Markdown
Contributor Author

Eric Amodio (@eamodio) I've made the relevant changes now

Comment thread extensions/git/src/autofetch.ts Outdated
this.disable();
} else {
this.enable();
switch (gitConfig.get<string | boolean>('autofetch')) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't need to change this -- but FYI, you can change this to:

gitConfig.get<'all' | boolean>('autofetch')

to be more specific.

@eamodio
Eric Amodio (eamodio) merged commit 83f43be into microsoft:master Dec 11, 2020
@eamodio

Copy link
Copy Markdown
Contributor

Jason Williams (@jasonwilliams) Thanks so much for the contribution! 👍

@eamodio Eric Amodio (eamodio) added the feature-request Request for new features or functionality label Dec 11, 2020
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature-request Request for new features or functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Git: Allow option to "fetch --all" on autofetch

2 participants