Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
71e52007
Kaydet (Commit)
71e52007
authored
Agu 28, 2011
tarafından
Norbert Thiebaud
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
use translations' own hooks. update the hooks after the clone/fetch/pull
üst
76c1ec0c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
88 additions
and
35 deletions
+88
-35
g
g
+88
-35
No files found.
g
Dosyayı görüntüle @
71e52007
...
...
@@ -17,30 +17,83 @@ if [ "$#" -eq "0" ] ; then
exit
$?
fi
CLONEDIR
=
$(
perl
-e
'use Cwd "abs_path"; print abs_path(shift);'
$0
|
sed
-e
' s/\/g$/\/clone/'
)
if
[
!
-e
${
CLONEDIR
}
]
;
then
mkdir
-p
$CLONEDIR
;
fi
RAWBUILDDIR
=
$(
perl
-e
'use Cwd "abs_path"; print abs_path(shift);'
$0
|
sed
-e
' s/\/g$//'
)
if
[
!
-e
${
RAWBUILDDIR
}
]
;
then
mkdir
-p
$RAWBUILDDIR
;
fi
# should we need to update the hooks
function
update_hooks
()
pushd
$(
dirname
$0
)
>
/dev/null
COREDIR
=
$(
pwd
)
popd
>
/dev/null
refresh_hooks
()
{
HOOKDIR
=
"
$1
"
for
H
in
$(
cd
"
$RAWBUILDDIR
/git-hooks"
;
echo
*)
;
do
HOOK
=
".git/hooks/
$H
"
if
[
!
-x
"
$HOOK
"
-a
!
-L
"
$HOOK
"
]
;
then
rm
-f
"
$HOOK
"
ln
-s
"
$HOOKDIR
/
$H
"
"
$HOOK
"
fi
repo
=
$1
case
"
$repo
"
in
core
)
pushd
$COREDIR
>
/dev/null
for
hook_name
in
$(
ls
-1
$COREDIR
/git-hooks
)
;
do
hook
=
".git/hooks/
$hook_name
"
if
[
!
-x
"
$hook
"
-a
!
-L
"
$hook
"
]
;
then
rm
-f
"
$hook
"
ln
-s
"git-hooks/
$hook_name
"
"
$hook
"
fi
done
popd
>
/dev/null
;;
translations
)
if
[
-d
$COREDIR
/clone/translations
]
;
then
pushd
$COREDIR
/clone/translations
>
/dev/null
for
hook_name
in
$(
ls
-1
$COREDIR
/clone/translations/git-hooks
)
;
do
hook
=
".git/hooks/
$hook_name
"
rm
-f
"
$hook
"
ln
-sf
"git-hooks/
$hook_name
"
"
$hook
"
done
# .gitattribute should be per-repo, avoid entangling repos
if
[
-L
.gitattributes
]
;
then
rm
-f
.gitattributes
fi
popd
>
/dev/null
fi
;;
help
|
dictionaries
)
if
[
-d
$COREDIR
/clone/
$core
]
;
then
pushd
$COREDIR
/clone/
$core
>
/dev/null
# fixme: we should really keep these per-repo to
# keep the repos independant. since these two
# are realy not independant yet, we keep using core's hooks
for
hook_name
in
$(
ls
-1
$COREDIR
/git-hooks
)
;
do
hook
=
".git/hooks/
$hook_name
"
rm
-f
"
$hook
"
ln
-sf
"
$COREDIR
/git-hooks/
$hook_name
"
"
$hook
"
done
# .gitattribute should be per-repo, avoid entangling repos
if
[
-L
.gitattributes
]
;
then
rm
-f
.gitattributes
fi
popd
>
/dev/null
fi
;;
esac
}
refresh_all_hooks
()
{
repos
=
"core
$(
cat
"
$COREDIR
/bin/repo-list"
)
"
for
repo
in
$repos
;
do
refresh_hooks
$repo
done
if
[
-z
"
$(
git config push.default
)
"
]
;
then
git config push.default tracking
fi
if
[
"
$PWD
"
!=
"
$RAWBUILDDIR
"
-a
!
-e
.gitattributes
]
;
then
ln
-s
$RAWBUILDDIR
/.gitattributes
.
}
postprocess
()
{
rc
=
$1
if
$DO_HOOK_REFRESH
;
then
refresh_all_hooks
fi
exit
$rc
;
}
CLONEDIR
=
"
$COREDIR
/clone"
if
[
!
-e
${
CLONEDIR
}
]
;
then
mkdir
-p
"
$CLONEDIR
"
;
fi
# extra params for some commands, like log
EXTRA
=
COMMAND
=
"
$1
"
...
...
@@ -51,6 +104,7 @@ ALLOW_EMPTY=
KEEP_GOING
=
0
REPORT_REPOS
=
1
REPORT_COMPACT
=
0
DO_HOOK_REFRESH
=
false
while
[
"
${
COMMAND
:0:1
}
"
=
"-"
]
;
do
case
"
$COMMAND
"
in
...
...
@@ -74,6 +128,9 @@ case "$COMMAND" in
EXTRA
=
"-p0 --stat --apply --index --ignore-space-change --whitespace=error"
RELATIVIZE
=
0
;;
clone|fetch|pull
)
DO_HOOK_REFRESH
=
true
;;
diff
)
PAGER
=
'--no-pager'
REPORT_REPOS
=
0
...
...
@@ -147,18 +204,14 @@ done
# do it!
DIRS
=
"core
$(
cd
$CLONEDIR
;
ls
)
"
if
[
"
$COMMAND
"
=
"clone"
]
;
then
DIRS
=
$(
cat
"
$RAWBUILDDIR
/bin/repo-list"
)
# update hooks in the main repo too
(
cd
"
$RAWBUILDDIR
"
;
update_hooks
"../../git-hooks"
)
DIRS
=
$(
cat
"
$COREDIR
/bin/repo-list"
)
fi
for
REPO
in
$DIRS
;
do
DIR
=
"
$CLONEDIR
/
$REPO
"
NAME
=
"
$REPO
"
HOOKDIR
=
"../../../../git-hooks"
if
[
"
$REPO
"
=
"core"
]
;
then
DIR
=
"
$
RAWBUILD
DIR
"
DIR
=
"
$
CORE
DIR
"
NAME
=
"main repo"
HOOKDIR
=
"../../git-hooks"
fi
if
[
-d
"
$DIR
"
-a
"z
$PUSH_USER
"
!=
"z"
]
;
then
...
...
@@ -169,7 +222,6 @@ for REPO in $DIRS ; do
# executed in a subshell
if
[
"
$COMMAND
"
!=
"clone"
]
;
then
cd
"
$DIR
"
update_hooks
"
$HOOKDIR
"
else
cd
"
$CLONEDIR
"
fi
...
...
@@ -248,21 +300,20 @@ for REPO in $DIRS ; do
# now we can change the dir in case of clone as well
if
[
"
$COMMAND
"
=
"clone"
]
;
then
cd
$DIR
update_hooks
"
$HOOKDIR
"
fi
case
"
$COMMAND
"
in
pull|clone
)
# update links
if
[
"
$DIR
"
!=
"
$
RAWBUILD
DIR
"
]
;
then
if
[
"
$DIR
"
!=
"
$
CORE
DIR
"
]
;
then
for
link
in
$(
ls
)
;
do
if
[
!
-e
"
$
RAWBUILD
DIR
/
$link
"
]
;
then
if
test
-h
"
$
RAWBUILD
DIR
/
$link
"
;
then
rm
"
$
RAWBUILD
DIR
/
$link
"
if
[
!
-e
"
$
CORE
DIR
/
$link
"
]
;
then
if
test
-h
"
$
CORE
DIR
/
$link
"
;
then
rm
"
$
CORE
DIR
/
$link
"
echo
-n
"re-"
fi
echo
"creating missing link
$link
"
ln
-s
"
$DIR
/
$link
"
"
$
RAWBUILD
DIR
/
$link
"
ln
-s
"
$DIR
/
$link
"
"
$
CORE
DIR
/
$link
"
fi
done
fi
...
...
@@ -282,16 +333,16 @@ for REPO in $DIRS ; do
fi
exit
$RETURN
)
||
exit
$?
)
||
postprocess
$?
fi
done
# Cleanup the broken links
if
[
"
$COMMAND
"
=
"pull"
]
;
then
for
link
in
$(
ls
$
RAWBUILD
DIR
)
;
do
if
[
-h
"
$
RAWBUILDDIR
/
$link
"
-a
!
-e
"
$RAWBUILD
DIR
/
$link
"
]
;
then
for
link
in
$(
ls
$
CORE
DIR
)
;
do
if
[
-h
"
$
COREDIR
/
$link
"
-a
!
-e
"
$CORE
DIR
/
$link
"
]
;
then
echo
"Removing broken link
$link
"
rm
$
RAWBUILD
DIR
/
$link
rm
$
CORE
DIR
/
$link
fi
done
fi
...
...
@@ -303,4 +354,6 @@ if [ "$COMMAND" = "apply" ] ; then
echo
fi
postprocess
$?
# vi:set shiftwidth=4 expandtab:
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment