Skip to content

Avoid loading or migrating the user config in daemon mode - #6001

Open
stefanhaller wants to merge 3 commits into
masterfrom
fix-daemon-wrt-config
Open

Avoid loading or migrating the user config in daemon mode#6001
stefanhaller wants to merge 3 commits into
masterfrom
fix-daemon-wrt-config

Conversation

@stefanhaller

Copy link
Copy Markdown
Collaborator

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant