From c6206d3fc1de25bf94ae3e1cbda9b1fb7b0153df Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Fri, 12 Jan 2024 19:53:07 +0300 Subject: [PATCH] config/git: fix repo handling --- .config/git/config | 3 ++- .local/bin/scripts/git-repo | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.config/git/config b/.config/git/config index ff7a704..f77dcd6 100644 --- a/.config/git/config +++ b/.config/git/config @@ -111,12 +111,13 @@ lg = lgr HEAD @{push} lo = log --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset' --date=human --no-merges lp = log -p --date=local # Like --full-diff - my = lo --author "xeru\\|anek" + my = lo --author "xeru\\|anek\\|melonion" standup = my --since yesterday --all co-authors = !git log | grep -i Co-Authored | awk '!a[$0]++' when = !git for-each-ref --sort=committerdate --format='%(refname:short) * %(authorname) * %(committerdate:relative)' refs/remotes/ # List all branches with their last updates + tags = !sh -c "git for-each-ref --color=always --format='%(color:yellow)%(tag)%(color:default)%09 %(subject) %(color:green)(%(taggerdate:format:%Y-%m-%d))' refs/tags | sort -V | column -s $'\t' -t" find = log --patch --all --full-history # Find a filename in all git knows ref = reflog show --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset' refg = log --reflog --graph --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset' diff --git a/.local/bin/scripts/git-repo b/.local/bin/scripts/git-repo index dce0389..b88ef1a 100755 --- a/.local/bin/scripts/git-repo +++ b/.local/bin/scripts/git-repo @@ -14,12 +14,13 @@ case "$1" in echo "$1" exit;; esac -case $1 in +host=$1 +case $host in (socha) user=software-challenge; host=git@github.com;; - (hub) host=git@github.com;; + (hub|github) host=git@github.com;; (lab) host=git@gitlab.com;; - (jf) host=${1:-gitea@git.jfischer.org};; - (*|ftt) host=git@code.ftt.gmbh; user=janek;; + (jf) host=gitea@git.jfischer.org;; + (ftt|"") host=git@code.ftt.gmbh; user=janek;; esac user=${3:-${user:-$(git config user.name)}} repo=${2:-$(basename $(git root))}