mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
$(TOPDIR), make, scripts: Merged changes from V_1_2_3_33_YAPPLICATION_INIFILE_CTOR
Signed-off-by: Jan Lindemann <jan@jannet.de>
This commit is contained in:
parent
6fbb886828
commit
78bd6215b4
12 changed files with 346 additions and 28 deletions
100
scripts/pgit.sh
Normal file
100
scripts/pgit.sh
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
#!/bin/sh
|
||||
|
||||
log()
|
||||
{
|
||||
echo $@
|
||||
}
|
||||
|
||||
err()
|
||||
{
|
||||
log $@
|
||||
}
|
||||
|
||||
fatal()
|
||||
{
|
||||
err $@
|
||||
exit 1
|
||||
}
|
||||
|
||||
marker()
|
||||
{
|
||||
log "# ============= $@"
|
||||
}
|
||||
|
||||
config()
|
||||
{
|
||||
pdir=`pwd`
|
||||
while [ `basename $pdir` != proj ]; do
|
||||
[ "$pdir" = / ] && fatal "didn't find \"proj\" in directory components"
|
||||
pdir=`dirname $pdir`
|
||||
done
|
||||
pdirs=`(cd $pdir; ls -d */.git | sed 's%/.git%%')`
|
||||
}
|
||||
|
||||
# ------------- commands
|
||||
clone()
|
||||
{(
|
||||
local p
|
||||
config
|
||||
cd $pdir
|
||||
local id=`whoami`
|
||||
local projects=`ssh git.jannet.de /opt/ytools/bin/git-srv-admin.sh list-personal-projects`
|
||||
for p in $projects; do
|
||||
[ -d $p ] && {
|
||||
marker "skipping existing $p"
|
||||
continue
|
||||
}
|
||||
marker "cloning $p"
|
||||
git clone ssh://$id@git.jannet.de/srv/git/$id/proj/$p
|
||||
done
|
||||
)}
|
||||
|
||||
pull()
|
||||
{(
|
||||
local d
|
||||
config
|
||||
cd $pdir
|
||||
for d in $pdirs; do
|
||||
marker "$d"
|
||||
($d; git pull origin master)
|
||||
done
|
||||
)}
|
||||
|
||||
diff()
|
||||
{(
|
||||
local d
|
||||
config
|
||||
cd $pdir
|
||||
for d in $pdirs; do
|
||||
marker $d
|
||||
(cd $d; git diff --src-prefix=a/$d/ --dst-prefix=b/$d/ "$@")
|
||||
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 origin master)
|
||||
done
|
||||
)}
|
||||
|
||||
cmd=$1
|
||||
shift
|
||||
$cmd "$@"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue