From ab0bf8de25958e8ffa3d2653f2101d68304e66ef Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Fri, 16 Aug 2024 10:26:28 -0300 Subject: [PATCH] Remove debug statements from git cptob alias --- home/dot_gitconfig.tmpl | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/home/dot_gitconfig.tmpl b/home/dot_gitconfig.tmpl index 3900d9d..9712e90 100644 --- a/home/dot_gitconfig.tmpl +++ b/home/dot_gitconfig.tmpl @@ -37,22 +37,26 @@ path = ~/.config/gitalias/gitalias.txt caa = commit --amend --all caane = commit --amend --all --no-edit cob = checkout -b + apply-gitignore = "!f() { \ set -ex; \ git rm -r --cached . >/dev/null; \ git add .; \ };f" + remote-for-branch = "!f() { \ set -ex; \ branch="${1:-"$(git current-branch)"}"; \ git rev-parse --abbrev-ref --symbolic-full-name "${branch}@{upstream}" | sed -n 's,^\\(\\S*\\)/'"${branch}"'$,\\1,p' | grep .; \ };f" + rr = "!f() { \ set -ex; \ branch="${1:-"$(git current-branch)"}"; \ remote="$(git remote-for-branch "${branch}")"; \ git reset --hard "${remote}/${branch}"; \ };f" + pfor = "!f() { \ set -ex; \ branch="$(echo "${1}" | cut -d'%' -f1)"; \ @@ -62,11 +66,13 @@ pfor = "!f() { \ remote="$(git remote-for-branch "${branch}")"; \ git push "${remote}" "HEAD:refs/for/${branch}${push_opts}"; \ };f" + psfor = "!f() { \ set -ex; \ git caane; \ git pfor "$@"; \ };f" + cptob = "!f() { \ set -ex; \ commit="${1}"; \ @@ -80,10 +86,10 @@ cptob = "!f() { \ fi; \ \ for branch in "${@}"; do \ - echo git co "${branch}"; \ - echo git rr "${branch}"; \ - echo git pr; \ - echo git cp "${commit}"; \ - echo git pfor "${branch}${push_opts}"; \ + git co "${branch}"; \ + git rr "${branch}"; \ + git pr; \ + git cp "${commit}"; \ + git pfor "${branch}${push_opts}"; \ done; \ };f"