Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jesseduffield/lazygit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: jesseduffield/lazygit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: BlakeWilliams/master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Dec 31, 2024

  1. Add support for ~/.config/lazygit without setting XDG_CONFIG_HOME

    Currently lazygit looks for its config file in `XDG_CONFIG_HOME` if it's
    available, but if not it falls back to the defaults defined by the
    [xdg](https://github.com/adrg/xdg) package. Unfortunately the defaults
    the package falls back to isn't what CLI applications commonly fall back
    to on macOS. Specifically, it looks in `~/Library/Application Support`
    instead of `~/.config`.
    
    This updates the app config logic to:
    
    - Look for `~/.config/lazygit` first if `XDG_CONFIG_HOME` is not set
      and we're on macOS.
    - Fallback to the existing `xdg` package location if the configuration
      file exists there.
    - Default to `~/.config/lazygit/config.yml` if `XDG_CONFIG_HOME` is not
      set, we're on macOS, and there is no existing configuration file.
    
    This change did feel a bit like having to thread a needle and I didn't
    see any existing tests for this behavior (which is reasonable, since it's
    complicated and OS dependent) so I did test a few variations of the
    configuration locally by building with this change included and running
    a `brew` installed lazygit.
    
    It seemed to work properly, falling back to the existing location when
    `XDG_CONFIG_HOME` isn't set, using `~/.config/lazygit` when `config.yml`
    is present, and creating `~/.config/lazygit/config.yml` when it's not.
    
    I think this should resolve #1341
    BlakeWilliams authored and jesseduffield committed Dec 31, 2024
    Configuration menu
    Copy the full SHA
    59f0650 View commit details
    Browse the repository at this point in the history
Loading