Add pub-git-init

This commit is contained in:
Austen Adler 2015-12-29 23:51:16 -05:00
parent 7cfbe5fe5e
commit e593c7f4e4

View File

@ -235,25 +235,32 @@ function rc(){
*) echo "Opts:\nz v i\nuse make unmask mask accept_keywords" *) echo "Opts:\nz v i\nuse make unmask mask accept_keywords"
esac esac
} }
function ncsu-git-init(){ function pub-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) # Get the project name
echo Branch will be: $branch branch=$(git remote -v | ag '^origin\s+' | sed -e 's/^origin\s*//' | cut -d\ -f1 | sed -e 's/^.\+\///' -e 's/\.git$//' | head -n1)
remote="gcrypt::git@gitlab.com:stonewareslord/e6e03ea006d55de0970a28bcb7fcf65f4c66f98f50830bd69b50c5dc502bdf1a4e4172187cfb5fcef8c32bd7fb316bdc67d7d86713ebfe232f97eb303ac316ae.git#$branch" # Get the hashed project name
echo -n "Add $remote? " enc_branch=$("$branch" | sha512sum | cut -d\ -f1)
read a git remote add local "git@localhost:$branch"
git remote add ncsu $remote 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" git config remote.ncsu.gcrypt-participants "CCDFE3F1"
echo -n "Push? " git config remote.gitlab.gcrypt-participants "CCDFE3F1"
read a
git push ncsu --all
git push ncsu --tags
} }
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) branch=$(echo $1 | sha512sum | cut -d\ -f1)
echo Branch will be: $branch git clone "$remote$branch" $1
echo -n "Continue?"
read a
git clone "gcrypt::git@gitlab.com:stonewareslord/e6e03ea006d55de0970a28bcb7fcf65f4c66f98f50830bd69b50c5dc502bdf1a4e4172187cfb5fcef8c32bd7fb316bdc67d7d86713ebfe232f97eb303ac316ae.git#$branch" $1
} }
function k(){ function k(){
#More than 1 arguement #More than 1 arguement