Skip to content

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

Closed

Description

VScode has a "git.autofetch" option which periodically fetches from upstream. However, when forking a project (which a lot of us do) you will only ever fetch from origin. In my case I want to periodically fetch from upstream too so I can have up-to-date changes from others working on the same project.

On the command line the change would be adding --all. In terms of the built-in extension the change would be here:
https://github.com/microsoft/vscode/blob/master/extensions/git/src/autofetch.ts#L102

Today fetchDefault is always called. fetchAll exists and could be called instead if an option is set to true.

Example Config

It would make sense for autoFetch to take a series of options like, "all", "current", "off". But im assuming we can't modify this option now as it's being used.

  "git.autofetch": true, // Most likely can't change this now
  "git.autofetchAll": true, // fetchAll when fetching (overriding above)

Activity

  1. jasonwilliams commented on Nov 18, 2020

    @jasonwilliams
    ContributorAuthor

    After some thought I think fetchAll makes a better default than fetchDefault because then extensions like gitlens would work better out the box on remote views.
    If a developer is working from a fork it would mainly just work. If you work on a central repository (no forks) you would only have 1 remote anyway so fetchAll would continue to operate the same way.

  2. added this to the Backlog milestone on Nov 19, 2020
  3. added
    help wanted
    on Nov 19, 2020
  4. eamodio commented on Nov 19, 2020

    @eamodio
    Contributor

    I think we can probably get away with adding an all option to git.autofetch.

  5. jasonwilliams commented on Nov 19, 2020

    @jasonwilliams
    ContributorAuthor

    So the options for git.autofetch would be true | false | “all” ?

  6. jasonwilliams commented on Nov 20, 2020

    @jasonwilliams
    ContributorAuthor

    I think we can probably get away with adding an all option to git.autofetch.

    "autofetch" is "type": "boolean" so i don't know how that will be possible https://github.com/microsoft/vscode/blob/master/extensions/git/package.json#L1647

  7. jasonwilliams commented on Nov 21, 2020

    @jasonwilliams
    ContributorAuthor

    Eric Amodio (@eamodio) I had a go at this here: #111090
    What do you think?

  8. added
    unreleased
    on Dec 11, 2020
  9. added
    feature-request
    on Dec 11, 2020
  10. added
    insiders-released
    and removed
    unreleased
    on Dec 11, 2020
  11. locked and limited conversation to collaborators on Jan 25, 2021
  12. eamodio commented on Jan 26, 2021

    @eamodio
    Contributor

    Verify that setting "git.autofetch": 'all' fetches all remotes, and still that false stop auto-fetching, and that true fetches the default remote

  13. added
    author-verification-requested
    verification-needed
    on Jan 26, 2021
  14. added
    verified
    and removed
    verification-needed
    on Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

author-verification-requestedfeature-requestgithelp wantedinsiders-releasedverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions