From 870cf534094f32148712fe0ef99cb819d0e4c02f Mon Sep 17 00:00:00 2001 From: kalmenn Date: Fri, 22 Dec 2023 17:48:57 +0100 Subject: [PATCH] identity: implemented the set subcommand --- scripts/identity.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scripts/identity.sh b/scripts/identity.sh index 2e77d41..948d177 100755 --- a/scripts/identity.sh +++ b/scripts/identity.sh @@ -120,6 +120,26 @@ case $1 in list) list_identities; ;; + set) + if [ -z "$2" ]; then + echo "USAGE:"; + echo " git identity set "; + echo; + echo "Copies the config from the requested identity file to the local repo's config."; + echo "Using set instead of link essentially means that future changes made to the identity file will not sync to this repo."; + echo "If you wish for that be the case, consider using the link subcommand."; + exit 0; + fi + + get_identity "$2"; + + echo "Using this identity:"; + display_identity "$identity"; + + git config user.name "$name"; + [ ! -z "$email" ] && git config user.email "$email"; + [ ! -z "$sigkey" ] && git config user.signingKey "$sigkey"; + ;; *) echo "USAGE:"; echo " git identity ";