girocco-config.sh: new utility script
commitd5205b662cfb6043c670861776078684bbdb3ee5
authorKyle J. McKay <mackyle@gmail.com>
Mon, 1 Jan 2018 13:32:20 +0000 (1 05:32 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Mon, 1 Jan 2018 13:32:20 +0000 (1 05:32 -0800)
tree97d43dcd97e2c2bcf2bd265d92aa96922f38a696
parent5110818e0325e41108a795a6ed836a871cabfebb
girocco-config.sh: new utility script

When Girocco runs it uses a HOME directory set to:

  $Girocco::Config::chroot/etc/girocco

As a result, it finds "global" Git configuration values in
$Girocco::Config::chroot/etc/girocco/.gitconfig.

To protect against unfriendly foreign VCS mirrors and others leaving
a bunch of turds in there, that directory normally lacks write
permission for anyone.

However, it must have write access in order for the "git config"
command to modify the contents of the .gitconfig file it contains.

As a result of this, it's a tedious process to manually alter config
values stored in that file as first write permission has to be added
to the directory, then a longish "--file=..." argument has to be
provided to the "git config" command and then write permission once
again has to be removed from the directory.

Provide a convenient wrapper to eliminate the tedium.

The "girocco-config.sh" script semantically acts like an alias for:

  git config --file="$Girocco::Config::chroot/etc/girocco/.gitconfig" "$@"

except that it also adds the needed write permission to the directory
beforehand and removes it afterwards.

It's now much more convenient to manipulate Girocco's "global" Git
config defaults by using this new tool.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
toolbox/girocco-config.sh [new file with mode: 0755]