Skip to content

Commit

Permalink
Remove debug statements from git cptob alias
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecrs committed Aug 16, 2024
1 parent 9e122a1 commit ab0bf8d
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions home/dot_gitconfig.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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)"; \
Expand All @@ -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}"; \
Expand All @@ -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"

0 comments on commit ab0bf8d

Please sign in to comment.