diff --git a/shells/zshrc b/shells/zshrc index c56c020..fbe7881 100644 --- a/shells/zshrc +++ b/shells/zshrc @@ -235,25 +235,32 @@ function rc(){ *) echo "Opts:\nz v i\nuse make unmask mask accept_keywords" esac } -function ncsu-git-init(){ - branch=$(git remote -v | ag '^origin\s+' | sed -e 's/^origin\s*//' | cut -d\ -f1 | sed -e 's/^.\+\///' -e 's/\.git$//' | head -n1 | sha512sum | cut -d\ -f1) - echo Branch will be: $branch - remote="gcrypt::git@gitlab.com:stonewareslord/e6e03ea006d55de0970a28bcb7fcf65f4c66f98f50830bd69b50c5dc502bdf1a4e4172187cfb5fcef8c32bd7fb316bdc67d7d86713ebfe232f97eb303ac316ae.git#$branch" - echo -n "Add $remote? " - read a - git remote add ncsu $remote +function pub-git-init(){ + # Get the project name + branch=$(git remote -v | ag '^origin\s+' | sed -e 's/^origin\s*//' | cut -d\ -f1 | sed -e 's/^.\+\///' -e 's/\.git$//' | head -n1) + # Get the hashed project name + enc_branch=$("$branch" | sha512sum | cut -d\ -f1) + git remote add local "git@localhost:$branch" + git remote add ncsu "gcrypt::git@github.ncsu.edu:agadler/a86a0f8757772be2ec617b395a0716679bfce51c1bfdeb8da6127feebd84facde645e9e30188318344eb458f5834e3d86800.git#$enc_branch" + git remote add gitlab "gcrypt::git@gitlab.com:stonewareslord/e6e03ea006d55de0970a28bcb7fcf65f4c66f98f50830bd69b50c5dc502bdf1a4e4172187cfb5fcef8c32bd7fb316bdc67d7d86713ebfe232f97eb303ac316ae.git#$enc_branch" git config remote.ncsu.gcrypt-participants "CCDFE3F1" - echo -n "Push? " - read a - git push ncsu --all - git push ncsu --tags + git config remote.gitlab.gcrypt-participants "CCDFE3F1" } -function ncsu-git-clone(){ +function pub-git-clone(){ + case $1 in + ncsu) remote="gcrypt::git@github.ncsu.edu:agadler/a86a0f8757772be2ec617b395a0716679bfce51c1bfdeb8da6127feebd84facde645e9e30188318344eb458f5834e3d86800.git#" ;; + gitlab) remote="gcrypt::git@gitlab.com:stonewareslord/e6e03ea006d55de0970a28bcb7fcf65f4c66f98f50830bd69b50c5dc502bdf1a4e4172187cfb5fcef8c32bd7fb316bdc67d7d86713ebfe232f97eb303ac316ae.git#" ;; + #TODO: Fix enc_branch + local) remote="git@localhost:" ;; + *) echo "Opts: ncsu gitlab local" ; return 1 + esac + shift + if [ -z "$1" ] ; then + echo "No arg2" + return 2 + fi branch=$(echo $1 | sha512sum | cut -d\ -f1) - echo Branch will be: $branch - echo -n "Continue?" - read a - git clone "gcrypt::git@gitlab.com:stonewareslord/e6e03ea006d55de0970a28bcb7fcf65f4c66f98f50830bd69b50c5dc502bdf1a4e4172187cfb5fcef8c32bd7fb316bdc67d7d86713ebfe232f97eb303ac316ae.git#$branch" $1 + git clone "$remote$branch" $1 } function k(){ #More than 1 arguement