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

[Feature Request] Add keep_updated key in configuration file #72

Open
hukaidong opened this issue May 22, 2024 · 2 comments
Open

[Feature Request] Add keep_updated key in configuration file #72

hukaidong opened this issue May 22, 2024 · 2 comments

Comments

@hukaidong
Copy link

When I use grm to manage my dotfiles, I want them being updated if there's any commits from other devices. Currently grm only checks the existance of a repository but not keep them updated to remote. A "keep_updated=true" command would be wonderful to let grm know this repo should be actively pulled every time when it syncs.

@hakoerber
Copy link
Owner

Very cool idea. If I understand you correctly, this would be an option for the grm repos sync command, correct?

So, I guess this would be a switch that could be added, something like --pull. There are a few things to flesh out:

  • What if the merge part of the pull fails due to merge conflicts? Maybe this should default to --ff-only.
  • If not using --ff-only, a potential merge would usually open an editor window for the commit message of the merge. This would not work properly with the batch nature of grm repos sync. So it should behave like git pull --no-edit, using the default commit message for merges.
  • How does this work together with worktrees? Should each worktree be updated to upstream (like when using grm wt pull)?

I think the best approach would be to implement this to be analogous to running git pull --ff-only (or maybe --rebase) in each repository for non-worktrees, and analogous to grm wt pull for worktrees.

What do you think?

@hukaidong
Copy link
Author

I agree to have the pull command work as --ff-only. With update enabled, it is more likely you want to push your updates to remote upon changes everything. When it fails to pull, an error message of "some repo needs attention" would be enough for now.

I'm always keep my worktree stuff local so I don't have comments on the worktree setup right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants