mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +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
|
||||
run()
|
||||
{(
|
||||
local d
|
||||
local cmd=$1
|
||||
shift
|
||||
config
|
||||
cd $pdir
|
||||
|
||||
for d in $pdirs; do
|
||||
marker $d
|
||||
(cd $d; git $cmd "$@")
|
||||
done
|
||||
)}
|
||||
|
||||
clone()
|
||||
{(
|
||||
local p
|
||||
|
|
@ -51,28 +65,6 @@ clone()
|
|||
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()
|
||||
{(
|
||||
local d
|
||||
|
|
@ -84,30 +76,14 @@ diff()
|
|||
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
|
||||
shift
|
||||
$cmd "$@"
|
||||
case $cmd in
|
||||
clone|diff)
|
||||
$cmd "$@"
|
||||
;;
|
||||
*)
|
||||
run $cmd "$@"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue