Avoid loading or migrating the user config in daemon mode - #6001
Open
stefanhaller wants to merge 3 commits into
Open
Avoid loading or migrating the user config in daemon mode#6001stefanhaller wants to merge 3 commits into
stefanhaller wants to merge 3 commits into
Conversation
The log is the only thing it needs.
This is a preparation for passing only the logger to daemon.Handle instead of the whole common.
Daemon mode doesn't have any reason to read the user config or try to migrate it if it's old.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When performing an interactive rebase, a child process of lazygit is started as a rebase-todo editor, and sets (for example) the todo to "edit" that you want to stop at. This child process would load the user config as a normal lazygit does, and try to migrate it if it's out of date. This is a problem when you maintain your dot files including lazygit's config file in a git repo; if you rewrite the history of that repo, and stop at a commit before the last config migration, the child process tried to migrate the config mid-rebase, leading to confusing behavior. Avoid this; there's no reason for the child process to load the user config at all, it doesn't need it.
Note that if you stop in the rebase (e.g. because of a conflict), the normal focus-in refresh of the lazygit main process will still try to migrate the config at that time. This is the correct and expected behavior, nothing to fix there; the file will show up as modified in the Files panel, and needs to be discarded manually there before continuing.