flathub / com.syntevo.SmartGit

https://flathub.org/apps/details/com.syntevo.SmartGit
3 stars 3 forks source link

SmartGit Not Reading Git Config from Default Location #100

Closed wizpar closed 9 months ago

wizpar commented 9 months ago

Description

Git configuration, by default, is stored in $XDG_CONFIG_HOME/git/config — at the user-level. However, SmartGit is currently unable to read the configuration from this location. Instead, it only reads the config from $HOME/.gitconfig.

According to the official Git documentation, Git should prioritize reading configuration from $XDG_CONFIG_HOME/git/config before falling back to other locations.

Steps to Reproduce

  1. Configure Git settings in $XDG_CONFIG_HOME/git/config
  2. Open SmartGit and observe if the configurations are reflected

Current Behavior

SmartGit does not recognize configurations set in $XDG_CONFIG_HOME/git/config, relying solely on $HOME/.gitconfig.

Additional Information

N/A

x80486 commented 9 months ago

~This is not a Flatpak issue. SmartGit behaves like that. You can check the ZIP/TAR distribution to confirm.~

~@tmssngr (or @syntevo), do you think this is something you could take in your backlog?~

mstrap commented 9 months ago

With SmartGit 23.1, I cannot reproduce any problems here. It should take into account $XDG_CONFIG_HOME/git/config exactly as command line Git does: for every key, try to read from $HOME/.gitconfig and fallback to $XDG_CONFIG_HOME/git/config, if not found: https://github.com/git/git/blob/1a87c842ece327d03d08096395969aca5e0a6996/config.c#L2042

x80486 commented 9 months ago

I see $XDG_CONFIG_HOME mapped to $HOME/.var/app/com.syntevo.SmartGit/config/, so probably that's the issue. I would need to confirm this, but if I print $XDG_CONFIG_HOME in the Flatpak, it gives me that value, instead of $HOME/.config/ :man_shrugging:

x80486 commented 9 months ago

I fixed this in #101; not sure if that's the best way, but the solution is basically creating a link to $HOME/.config/git if it exists (and not linked already) within $HOME/.var/app/com.syntevo.SmartGit/config/.