commit 55f17c581882cda19efa403196cfe17e57dddce9
parent 18b98f2b82981e48666caf8c0a33f7874235ee82
Author: Alex Balgavy <alex@balgavy.eu>
Date: Thu, 17 Dec 2020 23:40:33 +0100
git: allow passing remote name to open/home aliases
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/git/gitconfig b/git/gitconfig
@@ -64,8 +64,8 @@
fuckit = reset --hard HEAD
fuckitall = reset --hard origin/master
ssh = "!git remote get-url origin | sed -E 's|^https?://([^/]+)/(.+)|git@\\1:\\2|' | tr -d '\n'"
- home = "!git remote get-url origin | sed -E 's|^git@([^:]+):|https://\\1/|' | tr -d '\n'"
- open = "!open $(git home)"
+ home = "!f(){ git remote get-url \"${1:-origin}\" | sed -E 's|^git@([^:]+):|https://\\1/|' | tr -d '\n'; }; f"
+ open = "!f(){ open $(git home \"$1\"); }; f"
dad = "!curl https://icanhazdadjoke.com/ && echo && git add"
reignore = "!git rm -r --cached .; git add ."
rb = "rebase --committer-date-is-author-date"