From e4b6c3c9ba73f8cd27aa7094082f1162a16351e0 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Wed, 6 Oct 2021 17:28:19 -0400 Subject: [PATCH] evaluate gpp upstream on cli --- bin/git_set_upstream | 12 ------------ fish.configlink/functions/abbrs.fish | 4 ++-- 2 files changed, 2 insertions(+), 14 deletions(-) delete mode 100755 bin/git_set_upstream diff --git a/bin/git_set_upstream b/bin/git_set_upstream deleted file mode 100755 index 553f3c8..0000000 --- a/bin/git_set_upstream +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Copied from David Pedersen: https://github.com/davidpdrsn/dotfiles/blob/master/bin/git-pp - -set -e - -git_branch_name() { - val=$( git branch 2>/dev/null | grep '^\*' | colrm 1 2 ) - echo "$val" -} - -git push --set-upstream origin "$(git_branch_name)" diff --git a/fish.configlink/functions/abbrs.fish b/fish.configlink/functions/abbrs.fish index 8e42bfd..20abe91 100644 --- a/fish.configlink/functions/abbrs.fish +++ b/fish.configlink/functions/abbrs.fish @@ -30,7 +30,7 @@ function abbrs --description 'All abbreviations' abbr -a gca 'git commit --amend' abbr -a gu 'git pull' abbr -a gp 'git push' - abbr -a gpp 'git_set_upstream' + abbr -a gpp git push --set-upstream origin (git branch 2>/dev/null | grep '^\*' | colrm 1 2) abbr -a gl 'git log --graph --decorate --oneline -20' abbr -a gll 'git log --graph --decorate --oneline' abbr -a gco 'git checkout' @@ -43,7 +43,7 @@ function abbrs --description 'All abbreviations' abbr -a grh 'git reset --hard' abbr -a gm 'git merge' abbr -a gcp 'git cherry-pick' - abbr -a cdg 'cd (git rev-parse --show-toplevel)' + abbr -a cdg cd (git rev-parse --show-toplevel) # GitHub abbr -a ghr 'gh repo view -w'