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

Add a config option to make --apply=false the default for chezmoi update #3539

Closed
infused-kim opened this issue Feb 5, 2024 · 2 comments · Fixed by #3540
Closed

Add a config option to make --apply=false the default for chezmoi update #3539

infused-kim opened this issue Feb 5, 2024 · 2 comments · Fixed by #3540
Labels
enhancement New feature or request

Comments

@infused-kim
Copy link

Is your feature request related to a problem? Please describe.

Most of the time when I use chezmoi update I don't want to immediately apply the changes. I usually want to review them first to see what the machine-specific differences will be. And oftentimes I also need to run chezmoi init first.

Describe the solution you'd like

A config option that causes chezmoi update to only pull in the changes, but not to apply them automatically.

[update]
   always_apply = false

Describe alternatives you've considered

In the meantime I have created a zsh and fish function that aliases the sub-command.

It's also possible to run chezmoi git pull, but it would be nice if this was a built-in feature as other people may have the same need.

My functions that other people can use in the meantime as a workaround:

chezmoi() {
    case "$1" in
        "update")
            command chezmoi update --apply=false
            ;;
        *)
            command chezmoi "$@"
            ;;
    esac
}
function chezmoi
    switch "$argv[1]"
        case "update"
            command chezmoi update --apply=false
        case "*"
            command chezmoi $argv
    end
end
@infused-kim infused-kim added the enhancement New feature or request label Feb 5, 2024
@halostatue
Copy link
Collaborator

Does

[update]
  args = ["--apply=false"]

not work?

I don't use the chezmoi update command (mostly because I am pushing from one machine to github; I don't currently have multiple machines that I worry about), so I'm not sure if it would work or not.

@infused-kim
Copy link
Author

Does

[update]
  args = ["--apply=false"]

not work?

I don't use the chezmoi update command (mostly because I am pushing from one machine to github; I don't currently have multiple machines that I worry about), so I'm not sure if it would work or not.

I just tried it and, unfortunately, it does not work.

But it looks like @twpayne already pushed a PR that adds this function!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants