topgrade icon indicating copy to clipboard operation
topgrade copied to clipboard

Git support fetch only

Open clinta opened this issue 1 year ago • 2 comments

An option to only fetch git repos instead of pulling them would be appreciated. I do not want my git working directory changed by topgrade. But a git fetch would be useful so I can instantly pull in the future.

clinta avatar May 18 '24 23:05 clinta

This looks like a reasonable feature, I think we can have a configuration entry to enable it:

[git]
# How many repos to pull at max in parallel
# max_concurrency = 5

# Additional git repositories to pull
# repos = [
#     "~/src/*/",
#     "~/.config/something"
# ]

# Don't pull the predefined git repos
# pull_predefined = false

# Arguments to pass Git when pulling Repositories
# arguments = "--rebase --autostash"

# If enabled, Topgrade only `git fetch`s the specified repositories instead of pulling them
fetch_only = false 

SteveLauC avatar Jun 16 '24 07:06 SteveLauC

Idly pondering if a slightly more general approach could be useful. For example, being able to configure update_command with a default of git pull to any override like git fetch or something else. Alternatively, perhaps there could even be a higher-level abstraction for various VCS systems, each with their own update_command default (and optional override). These thoughts are coming from https://github.com/topgrade-rs/topgrade/issues/1012

Walther avatar Dec 31 '24 11:12 Walther