A little safer and not much harder: use `git config -f`. Something like this, though you may need to test and tweak a little:
touch "${APP_CONFIG:=${HOME}/.config/myapp.conf}"
conf_has() { git config -f "${APP_CONFIG}" --get key."$1".val >/dev/null; }
conf_get() { git config -f "${APP_CONFIG}" --get key."$1".val; }
conf_set() { git config -f "${APP_CONFIG}" --replace-all key."$1".val "$2"; }
conf_del() { git config -f "${APP_CONFIG}" --unset-all key."$1".val; }
conf_list() { git config -f "${APP_CONFIG}" --get-regex '^key' | sed -e 's/^key.//' -e 's/\.val /\t/'; }