mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-26 23:23:55 +01:00
pgit.sh: Add support for default commands in pgit.sh
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
24f665abc2
commit
94a8363246
1 changed files with 22 additions and 46 deletions
|
|
@ -32,6 +32,20 @@ config()
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------- commands
|
# ------------- commands
|
||||||
|
run()
|
||||||
|
{(
|
||||||
|
local d
|
||||||
|
local cmd=$1
|
||||||
|
shift
|
||||||
|
config
|
||||||
|
cd $pdir
|
||||||
|
|
||||||
|
for d in $pdirs; do
|
||||||
|
marker $d
|
||||||
|
(cd $d; git $cmd "$@")
|
||||||
|
done
|
||||||
|
)}
|
||||||
|
|
||||||
clone()
|
clone()
|
||||||
{(
|
{(
|
||||||
local p
|
local p
|
||||||
|
|
@ -51,28 +65,6 @@ clone()
|
||||||
done
|
done
|
||||||
)}
|
)}
|
||||||
|
|
||||||
pull()
|
|
||||||
{(
|
|
||||||
local d
|
|
||||||
config
|
|
||||||
cd $pdir
|
|
||||||
for d in $pdirs; do
|
|
||||||
marker "$d"
|
|
||||||
(cd $d; git pull "$@")
|
|
||||||
done
|
|
||||||
)}
|
|
||||||
|
|
||||||
branch()
|
|
||||||
{(
|
|
||||||
local d
|
|
||||||
config
|
|
||||||
cd $pdir
|
|
||||||
for d in $pdirs; do
|
|
||||||
marker "$d"
|
|
||||||
(cd $d; git branch "$@")
|
|
||||||
done
|
|
||||||
)}
|
|
||||||
|
|
||||||
diff()
|
diff()
|
||||||
{(
|
{(
|
||||||
local d
|
local d
|
||||||
|
|
@ -84,30 +76,14 @@ diff()
|
||||||
done
|
done
|
||||||
)}
|
)}
|
||||||
|
|
||||||
commit()
|
|
||||||
{(
|
|
||||||
local d
|
|
||||||
config
|
|
||||||
cd $pdir
|
|
||||||
|
|
||||||
for d in $pdirs; do
|
|
||||||
marker $d
|
|
||||||
(cd $d; git commit "$@")
|
|
||||||
done
|
|
||||||
)}
|
|
||||||
|
|
||||||
push()
|
|
||||||
{(
|
|
||||||
local d
|
|
||||||
config
|
|
||||||
cd $pdir
|
|
||||||
for d in $pdirs; do
|
|
||||||
marker $d
|
|
||||||
(cd $d; git push "$@")
|
|
||||||
done
|
|
||||||
)}
|
|
||||||
|
|
||||||
cmd=$1
|
cmd=$1
|
||||||
shift
|
shift
|
||||||
|
case $cmd in
|
||||||
|
clone|diff)
|
||||||
$cmd "$@"
|
$cmd "$@"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
run $cmd "$@"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue