config/git: improve username handling
This commit is contained in:
parent
cefd400322
commit
e5332e9a48
|
@ -107,7 +107,7 @@
|
|||
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
|
||||
my = lo --author [Jj]anek
|
||||
my = lo --author "xeru\\|anek"
|
||||
|
||||
standup = my --since yesterday --all
|
||||
co-authors = !git log | grep -i Co-Authored | awk '!a[$0]++'
|
||||
|
|
|
@ -13,8 +13,11 @@ if test -d ".git"
|
|||
then repo="$(basename "$PWD")"
|
||||
git remote set-url origin "$(git-repo "${3:-github.com}" "$repo" "$2" "${@:4}")"
|
||||
else repo="$1" && shift
|
||||
# TODO cd into 1-/0-forks
|
||||
test -d "$d1" && cd "$d1/0-forks"
|
||||
if ! git-get "${3:-github.com}" "$repo" "${2:-$(git config --get user.name)}" "${@:4}"
|
||||
then repo="$1-$repo"
|
||||
git-get "${3:-github.com}" "$repo" "${2:-$(git config --get user.name)}" "${@:4}"
|
||||
fi
|
||||
cd "$(expr "$4" \| "$repo")"
|
||||
fi
|
||||
user="${1:-$repo}"
|
||||
|
|
|
@ -5,9 +5,11 @@ remote=$(git-repo "$@")
|
|||
echo "Cloning $remote"
|
||||
case $# in
|
||||
(1) dir=$(basename ${remote%.git});;
|
||||
(3) prefix=$(echo "$3" | sed "s|\(.\)\b.*$|\1|")
|
||||
(3) test "$3" != "$(git config --get user.name)" &&
|
||||
prefix=$(echo "$3" | sed "s|\(.\)\b.*$|\1|") &&
|
||||
case "$2" in
|
||||
("$prefix"*) ;;
|
||||
("$(git config --get user.name)") ;;
|
||||
(*) dir="${prefix}_$2";;
|
||||
esac;;
|
||||
esac
|
||||
|
|
Loading…
Reference in New Issue