System-files and personal-files request for onefetch

Onefetch requires access to the gitconfig file if it exists. It would be nice to allow autoconnect of system-files and personal-files to allow this access (GitHub issue).

plugs:
system-gitconfig:
  interface: system-files
  read:
  - /etc/gitconfig
global-gitconfig:
  interface: personal-files
  read:
  - $HOME/.gitconfig
  - $HOME/.config/git/config

Does onefetch also require access to ~/.git/config as well? Similar snaps usually require this too and this can be achieved in a similar manner using personal-files, e.g.:

plugs:
  etc-gitconfig:
    interface: system-files
    read:
    - /etc/gitconfig
  gitconfig:
    interface: personal-files
    read:
    - $HOME/.gitconfig
    - $HOME/.config/git/config

+1 to me for both these accesses since onefetch is a git tool and so requires access to these to function.

1 Like

Thanks for the heads up @alexmurray, you’re absolutely right. I updated the snapcraft.yaml and my initial post based on your remark

Ping @review-team, please review. Thank you.

@review-team Friendly reminder, I just need one more review.

Hi @o2sh, +1 from me for auto-connect of system-files for read access to /etc/gitconfig and personal-files for read access to $HOME/.gitconfig and $HOME/.config/git/config.

Could you please update the names of these plugs to etc-gitconfig and gitconfig (as in Alex’s example above), so that the interface names are consistent with other similar snaps? See the icdiff snap, for a similar example (https://snapcraft.io/icdiff).

1 Like

Hi @rayveldkamp, thanks for your response. I updated the configuration as you suggested.

Hi @o2sh, thanks for the update. The snap declaration has been updated; this is now live.