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

Added a programs.jujutsu.configFile file option to configure output… #5253

Closed
wants to merge 1 commit into from

Conversation

aftix
Copy link

@aftix aftix commented Apr 10, 2024

Description

Added a programs.jujutsu.configFile option to configure output location of programs.jujutsu.settings

I'm not sure if there's a convention on how to name options that relocate the config files.

Checklist

  • Change is backwards compatible.

The option defaults to the exact string that was previously used.

  • Code formatted with ./format.

./format slightly changed the formatting in parts of the file I didn't touch, I assume the format rules have changed since this file was last edited.

  • Code tested through nix-shell --pure tests -A run.all or nix develop --ignore-environment .#all using Flakes.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

Maintainer CC

@shikanime

Allows for setting the location `programs.jujutsu.settings` are written to.
Jujutsu supports both `~/.jjconfig.toml` and `$XDG_CONFIG_HOME/jj/config.toml`
by default.
@ambroisie
Copy link
Contributor

Why not just follow XDG_CONFIG_FILE always?

@shikanime
Copy link
Contributor

shikanime commented Apr 11, 2024

I don't think it's a good idea, similarly to other modules. Unfortunately there's some configuration files that doesn't follow the XDG spec, but I don't think jj fall into it.

@aftix
Copy link
Author

aftix commented Apr 11, 2024

What do you think isn't a good idea, following the XDG spec directly or having the location configurable? At this point I think the module should retain backwards compatibility and keep the file in ~/.jjconfig toml by default since I don't think jujutsu has any plans to stop supporting that location. My use case is I have XDG_CONFIG_HOME as a tmpfs and I'd like to keep configuration there

@ambroisie
Copy link
Contributor

should retain backwards compatibility and keep the file in ~/.jjconfig toml by default since I don't think jujutsu has any plans to stop supporting that location.

The programs.git module changed the location, and there is precedent for other modules switching to XDG_CONFIG_HOME unconditionnaly (e.g: programs.less).

@rycee
Copy link
Member

rycee commented May 10, 2024

Thanks for the contribution! I chose to merge #5207, however. I think if the program natively supports the XDG location then we should always use that.

@rycee rycee closed this May 10, 2024
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

Successfully merging this pull request may close these issues.

4 participants