jesseduffield / lazygit

simple terminal UI for git commands
MIT License
52.65k stars 1.84k forks source link

Move state.yml to $XDG_STATE_HOME/lazygit/state.yml #2794

Closed adriel-tech closed 5 months ago

adriel-tech commented 1 year ago

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

When using a dotfile manager like stow I end up moving state.yml between my many machines and state.yml seems like something that should be specific to each machine.

Describe the solution you'd like

Move state.yml to $XDG_STATE_HOME/lazygit/state.yml Which defaults too '~/.local/state/lazygit/state.yml' other programs such as neovim do this as an example.

Describe alternatives you've considered

The ability to disable state.yml or the ability to set its location in config.yml.

zhongdai commented 10 months ago

I got the same problem, the state file should not live together with the config file.

stefanhaller commented 10 months ago

@adriel-tech @zhongdai This should be fixed by #2936, could you test that please?

wiraki commented 5 months ago

Hello, I am confused. I see #2936 has been merged, but I still have the state.yml in my $XDG_CONFIG_HOME.

stefanhaller commented 5 months ago

The new code looks for the file in a few places, including where it used to be. When it finds it in any of them, it writes it back to the same location. This was a deliberate decision, here's some discussion about it.

If you want it in the new place, you'll have to move it there manually (or delete it from the old place if you don't care about what's stored in it, it will be recreated in the new place then).

wiraki commented 5 months ago

Thanks, that's cleared it! I peeked at that discussion but missed that part.

Edit: This can then be closed, I presume?

stefanhaller commented 5 months ago

Fixed by #2936.