config/git: update existing repos with git-fork
This commit is contained in:
parent
ad081d7a43
commit
5d6305bf86
|
@ -21,7 +21,7 @@ case $command in
|
||||||
git aur push --amend;;
|
git aur push --amend;;
|
||||||
(push)
|
(push)
|
||||||
makepkg --printsrcinfo > .SRCINFO
|
makepkg --printsrcinfo > .SRCINFO
|
||||||
git add -f .SRCINFO *.install
|
git add -f .SRCINFO *.install >/dev/null || true
|
||||||
git commit -v -a "$@"
|
git commit -v -a "$@"
|
||||||
git push;;
|
git push;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh -e
|
||||||
# Clones a fork and sets a corresponding upstream
|
# Clones a fork and sets a corresponding upstream
|
||||||
# ARGS
|
# ARGS
|
||||||
# - repo name
|
# - repo name
|
||||||
|
@ -6,8 +6,10 @@
|
||||||
# - local user
|
# - local user
|
||||||
# - url
|
# - url
|
||||||
# - target directory name (and further arguments to clone)
|
# - target directory name (and further arguments to clone)
|
||||||
set -e
|
if test -d ".git"
|
||||||
git-get "${4:-github.com}" "$1" "$3" "${@:5}"
|
then git remote set-url origin "$(git-repo "${4:-github.com}" "$1" "$3" "${@:5}")"
|
||||||
|
else git-get "${4:-github.com}" "$1" "$3" "${@:5}"
|
||||||
cd $(expr "$5" \| "$1")
|
cd $(expr "$5" \| "$1")
|
||||||
|
fi
|
||||||
test "$2" && git remote add upstream "$(git-repo "${4:-github.com}" "$1" "$2")"
|
test "$2" && git remote add upstream "$(git-repo "${4:-github.com}" "$1" "$2")"
|
||||||
git remote -v
|
git remote -v
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Translates different repo notations into ssh
|
# Translates different repo notations into ssh
|
||||||
case "$1" in
|
case "$1" in
|
||||||
http*) echo "git@$(echo "$1" | cut -d'/' -f3):$(echo "$1" | cut -d'/' -f4)/$(echo "$1" | cut -d'/' -f5)" ;;
|
(http*) echo $1 | sed "s|.*//\([^/]*\)/\(.*\)|git@\1:\2.git|";;
|
||||||
git:*) echo "$1" ;;
|
(git:*) echo "$1" ;;
|
||||||
*) echo "${1:-git.jfischer.org}:${3:-$(git config user.name)}/${2:-$(basename $PWD)}.git" ;;
|
(*) echo "${1:-git.jfischer.org}:${3:-$(git config user.name)}/${2:-$(basename $PWD)}.git" ;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in New Issue