Request for connection for charmcraft

Hello,

I’m building charmcraft, a snap that has an app that can, in some situations, try to run git, bzr, hg, and etc. (but focusing on those three for now). I’m trying to keep the snap strictly confined. So, I’d like to let these programs access (i.e. read) their configuration from the usual places. For git it’s fairly straightforward, exactly what I asked for for icdiff,

  gitconfig:
    interface: personal-files
    read:
      - $HOME/.gitconfig         # the old location
      - $HOME/.config/git/config # the new location (could change via XDG_CONFIG_HOME
                                 # and that isn't supported by snapd yet)

so at the very least I’d like to get the above sorted, please.


For hg it looks like I need something very similar (but I haven’t tested this in anger):

  hgrc:
    interface: personal-files
    read:
      - $HOME/.hgrc

but mercurial also has /etc/mercurial/hgrc so I’d also need

  system-hgrc:
    interface: system-files
    read:
    - /etc/mercurial/hgrc

Please.


For bzr (actually now brz) things seem to be harder: there’s ~/.bazaar/, and ~/.config/breezy/, and in that directory bazaar.conf/breezy.conf (respectively) is the default config file, but then there’s a bunch of other files that are also part of config, and a lockfile. I don’t know if that can work using this mechanism (if nobody has tried it before, I’ll have to try myself next month). Suggestions welcome.

Thank you :slight_smile:

1 Like

+1 for use of and auto-connect of gitconfig and hgrc. Since icdiff, we’ve standardized on interface references a bit more, so can you use this instead (since a number of snaps have used ‘gitconfig’, that is fine to keep as is):

  dot-hgrc:
    interface: personal-files
    read:
      - $HOME/.hgrc
  etc-hgrc:
    interface: system-files
    read:
    - /etc/mercurial/hgrc

@reviewers - can others please vote with the above interface references?

+1 from me too for gitconfig, dot-hgrc and etc-hgrc as defined above.

+2 votes for, 0 votes against. This is now live.