[Libreoffice-commits] .: 9 commits - bin/create_bootstrap_links binfilter config_host.mk.in configure.in dictionaries download g .git-hooks/commit-msg git-hooks/commit-msg .git-hooks/post-merge git-hooks/post-merge .git-hooks/pre-commit git-hooks/pre-commit .gitignore .gitmodules helpcontent2 translations writerfilter/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Oct 16 09:35:55 PDT 2012
.git-hooks/commit-msg | 173 ++++++++
.git-hooks/post-merge | 12
.git-hooks/pre-commit | 135 ++++++
.gitignore | 6
.gitmodules | 16
bin/create_bootstrap_links | 26 -
binfilter | 1
config_host.mk.in | 1
configure.in | 6
dictionaries | 1
download | 24 -
g | 631 +++++++++++++------------------
git-hooks/commit-msg | 173 --------
git-hooks/post-merge | 12
git-hooks/pre-commit | 135 ------
helpcontent2 | 1
translations | 1
writerfilter/source/filter/RtfFilter.cxx | 16
18 files changed, 662 insertions(+), 708 deletions(-)
New commits:
commit 42e965947327583355fe8a743d06da2debc654da
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Tue Oct 16 11:23:24 2012 -0500
rebase submodules
Change-Id: I96db9172e46697b372044f1fa73d5abbce9f3fe0
diff --git a/binfilter b/binfilter
index 6501eb7..45565e1 160000
--- a/binfilter
+++ b/binfilter
@@ -1 +1 @@
-Subproject commit 6501eb7a7f6ab7dba2223a5b8a721290ef1be627
+Subproject commit 45565e1ee1258814b1de7321647c2a7dea8832d5
diff --git a/dictionaries b/dictionaries
index ce1a435..508deb8 160000
--- a/dictionaries
+++ b/dictionaries
@@ -1 +1 @@
-Subproject commit ce1a4352c1dd4dde7c549eb31d1d40d56704fcbf
+Subproject commit 508deb804294871ff540f669350f093a191d2e8e
diff --git a/helpcontent2 b/helpcontent2
index 4507e5f..a7d7be2 160000
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 4507e5f21836724cf768cf4e3ffbbf4ada6c87c3
+Subproject commit a7d7be20a6379bbd96a41a93f1c0edd55f1eca51
diff --git a/translations b/translations
index f83717c..2548be5 160000
--- a/translations
+++ b/translations
@@ -1 +1 @@
-Subproject commit f83717cf73f4549d9ae09bc557d59316d4165394
+Subproject commit 2548be535019c0a869c5759419c6964db5f82471
commit c58b4fcd35e0772fcc6b457397fcb388deba8dd3
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Tue Oct 2 13:29:01 2012 -0500
missing fi in ./g
Change-Id: Ic763d7cd73c2a3df8e5d5146eaf795188d8c79d1
diff --git a/g b/g
index f70cac1..aa53015 100755
--- a/g
+++ b/g
@@ -147,6 +147,7 @@ local repo
if [ -n "$repo" ] ; then
cp -r "${repo?}" "${module?}/."
fi
+ fi
done
}
commit 3f136b50a9fbc5659170709284871e4a534d573c
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Tue Oct 2 13:24:09 2012 -0500
Updated core
Project: translations f83717cf73f4549d9ae09bc557d59316d4165394
null
add a README to the translations module
Change-Id: Iccfc83d5e9ec87802e88f83da1181493630805ea
Reviewed-on: https://gerrit.libreoffice.org/751
Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud at gmail.com>
diff --git a/translations b/translations
index 751ae9d..f83717c 160000
--- a/translations
+++ b/translations
@@ -1 +1 @@
-Subproject commit 751ae9de9563da8b26aef8e5c0f80ad502fbfe81
+Subproject commit f83717cf73f4549d9ae09bc557d59316d4165394
commit b4aab8089862a4b140b97c3c1bddde47601a257f
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Tue Oct 2 13:22:42 2012 -0500
gitsubmodule gerrit specific keyword seems to be 'branch' not 'revision'
Change-Id: I8dfaa7854755cc8db5cbea9c8f682975dcb31d4f
diff --git a/.gitmodules b/.gitmodules
index f44a16d..2bba7a2 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,16 +1,16 @@
[submodule "binfilter"]
path = binfilter
url = git://gerrit.libreoffice.org/binfilter
- revision = .
+ branch = .
[submodule "dictionaries"]
path = dictionaries
url = git://gerrit.libreoffice.org/dictionaries
- revision = .
+ branch = .
[submodule "helpcontent2"]
path = helpcontent2
url = git://gerrit.libreoffice.org/help
- revision = .
+ branch = .
[submodule "translations"]
path = translations
url = git://gerrit.libreoffice.org/translations
- revision = .
+ branch = .
diff --git a/dictionaries b/dictionaries
index 19dba71..ce1a435 160000
--- a/dictionaries
+++ b/dictionaries
@@ -1 +1 @@
-Subproject commit 19dba715c843961a18bbc8871373e33be165c4ab
+Subproject commit ce1a4352c1dd4dde7c549eb31d1d40d56704fcbf
commit a31714fb759a67a85a6007a70ba58f0530b24311
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Tue Oct 2 12:59:44 2012 -0500
add tag support to ./g, try to optimize pre->post submerge situation
Change-Id: I052817865da6df193c0451eccc3b8b6f507845a3
diff --git a/g b/g
index 7c6551c..f70cac1 100755
--- a/g
+++ b/g
@@ -125,6 +125,31 @@ get_configured_submodules()
fi
}
+do_shortcut_update()
+{
+local module
+local repo
+
+ for module in $SUBMODULES_CONFIGURED ; do
+ if [ ! -d ${module?}/.git ] ; then
+ case "${module?}" in
+ helcontent2)
+ if [ -d clone/help/.git ] ; then
+ repo="clone/help/.git"
+ fi
+ ;;
+ *)
+ if [ -d clone/${module?}/.git ] ; then
+ repo="clone/${module?}/.git"
+ fi
+ ;;
+ esac
+ if [ -n "$repo" ] ; then
+ cp -r "${repo?}" "${module?}/."
+ fi
+ done
+}
+
do_git_cmd()
{
echo "cmd:$@"
@@ -147,11 +172,13 @@ local module
create_branch=1
elif [ "$create_branch" = "1" ] ; then
branch="$arg"
+ create_branch=0
fi
done
if [ -f .gitmodules ] ; then
+ git submodule update
if [ -n "$branch" ] ; then
- git submodules foreach git branch ${branch} HEAD || return $?
+ git submodules foreach git checkout -b ${branch} HEAD || return $?
fi
else
# now that is the nasty case we moved prior to submodules
@@ -189,6 +216,8 @@ do_init_modules()
local module
local configured
+ do_shortcut_update
+
for module in $SUBMODULES_CONFIGURED ; do
configured=$(git config --local --get submodule.${module}.url)
if [ -z "$configured" ] ; then
@@ -265,7 +294,7 @@ case "$COMMAND" in
do_git_cmd ${COMMAND} "$@"
;;
checkout)
- do_checkout "$@" && git submodule foreach git checkout "$@"
+ do_checkout "$@"
;;
clone)
do_init_modules && git submodule update && refresh_all_hooks
@@ -290,6 +319,9 @@ case "$COMMAND" in
reset)
do_reset
;;
+ tag)
+ do_git_cmd ${COMMAND} "$@"
+ ;;
*)
echo "./g does not support command:$COMMAND" 1>&2
exit 1;
commit 2c5cdc4d3e479576f13e4307f0be1c6170e34756
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Tue Oct 2 10:32:45 2012 -0500
when switching to a pre-submodule point, clean-up the soft-link point
Change-Id: I5a8f144bb4ad167cfa0e6763e3cf273b9127d65b
diff --git a/g b/g
index d73b8a6..7c6551c 100755
--- a/g
+++ b/g
@@ -137,6 +137,7 @@ do_checkout()
local cmd
local create_branch="0"
local branch
+local module
git checkout "$@" || return $?
for cmd in "$@" ; do
@@ -154,6 +155,11 @@ local branch
fi
else
# now that is the nasty case we moved prior to submodules
+ # delete the submodules left over if any
+ for module in $SUBMODULES_ALL ; do
+ echo "clean-up submodule $module"
+ rm -fr ${module}
+ done
# make sure we have the needed repo in clone
./g clone && ./g -f checkout "$@" || return $?
fi
@@ -167,6 +173,11 @@ do_reset()
git submodule update || return $?
else
# now that is the nasty case we moved prior to submodules
+ # delete the submodules left over if any
+ for module in $SUBMODULES_ALL ; do
+ echo "clean-up submodule $module"
+ rm -fr ${module}
+ done
# make sure we have the needed repo in clone
./g clone && ./g -f reset "$@"
fi
commit 942a8ffd255e64a018a9c4d66b8524dd5e6df01c
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Tue Oct 2 10:09:30 2012 -0500
typo in configure.in wrt the name of the helpcontent2 module
Change-Id: Id0d7335872c2e2c074769bd7edc1b7301b1ebdbe
diff --git a/configure.in b/configure.in
index 9f15c97..5f5b02d 100644
--- a/configure.in
+++ b/configure.in
@@ -4359,7 +4359,7 @@ if test "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
BUILD_TYPE="$BUILD_TYPE HELP"
SCPDEFS="$SCPDEFS -DWITH_HELP"
GIT_REPO_NAMES="$GIT_REPO_NAMES help"
- GIT_NEEDED_SUBMODULES="helcontent2 $GIT_NEEDED_SUBMODULES"
+ GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
else
AC_MSG_RESULT([no])
fi
commit 9152c42a65c199893d2d2809153a709bd2f619f8
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Mon Oct 1 23:48:10 2012 -0500
submodules migration
Change-Id: Ib3e472a4b1abf880f695be7a6667393d6a82f10d
diff --git a/.git-hooks/commit-msg b/.git-hooks/commit-msg
new file mode 100755
index 0000000..fa0b2e2
--- /dev/null
+++ b/.git-hooks/commit-msg
@@ -0,0 +1,173 @@
+#!/bin/sh
+#
+# An example hook script to check the commit log message.
+# Called by git-commit with one argument, the name of the file
+# that has the commit message. The hook should exit with non-zero
+# status after issuing an appropriate message if it wants to stop the
+# commit. The hook is allowed to edit the commit message file.
+#
+# To enable this hook, make this file executable.
+
+# Uncomment the below to add a Signed-off-by line to the message.
+# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
+# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
+
+# This example catches duplicate Signed-off-by lines.
+
+base_dir=$(dirname $0)
+MSG="$1"
+
+abort() {
+ cp $1 $1.save
+ cat >&2 <<EOF
+Commit aborted, your commit message was saved as '$1.save'.
+
+Reason: $2
+
+EOF
+ exit 1
+}
+
+test "" = "$(grep '^Signed-off-by: ' "$1" |
+ sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
+ abort "$1" "Duplicate Signed-off-by lines."
+}
+
+# Check that the first line exists, and is not an asterisk
+
+if [ -z "`head -n 1 $1 | grep -v '^[ \t]*\*$'`" ] ; then
+ abort "$1" "Please provide the general description on the first line."
+fi
+
+# ...and that it is not too long
+
+if [ "`head -n 1 $1 | wc -c`" -gt 79 ] ; then
+ abort "$1" "The first line is too long, please try to fit into 79 characters."
+fi
+
+# ...and that it does not continue on the second line
+if [ "`wc -l < $1`" -gt 1 -a -n "`head -n 2 $1 | tail -n 1 | sed 's/^#.*//'`" ] ; then
+ abort "$1" "The second line is not empty - maybe the first line continues there?"
+fi
+
+# Check that the message is not a ChangeLog-like one
+
+if [ -n "`head -n 1 $1 | grep '^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.*<.*@.*>'`" ] ; then
+ abort "$1" "The commit message looks like ChangeLog, please use the git form."
+fi
+
+# Check for whitespace in front of *'s
+
+if [ -n "`sed '/^#/,$d' $1 | grep '^[[:space:]]\+\*.*:'`" -a -z "`grep '^\*' $1`" ] ; then
+ abort "$1" "Please don't use whitespace in front of '* file: Description.' entries."
+fi
+
+#------------------ copied gerrit commit-msg hook to handle ChangeId -->
+# From Gerrit Code Review 2.3
+#
+# Part of Gerrit Code Review (http://code.google.com/p/gerrit/)
+#
+# Copyright (C) 2009 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+CHANGE_ID_AFTER="Bug|Issue"
+
+# Check for, and add if missing, a unique Change-Id
+#
+add_ChangeId() {
+ clean_message=`sed -e '
+ /^diff --git a\/.*/{
+ s///
+ q
+ }
+ /^Signed-off-by:/d
+ /^#/d
+ ' "$MSG" | git stripspace`
+ if test -z "$clean_message"
+ then
+ return
+ fi
+
+ id=`grep -i '^Change-Id:' "$MSG" | sed -e "s/.*: I//"`
+ temp_msg=`grep -v -i '^Change-Id:' "$MSG"`
+ echo "$temp_msg" > "$MSG"
+
+ if test -z "$id"
+ then
+ id=`_gen_ChangeId`
+ fi
+ perl -e '
+ $MSG = shift;
+ $id = shift;
+ $CHANGE_ID_AFTER = shift;
+
+ undef $/;
+ open(I, $MSG); $_ = <I>; close I;
+ s|^diff --git a/.*||ms;
+ s|^#.*$||mg;
+ exit unless $_;
+
+ @message = split /\n/;
+ $haveFooter = 0;
+ $startFooter = @message;
+ for($line = @message - 1; $line >= 0; $line--) {
+ $_ = $message[$line];
+
+ if (/^[a-zA-Z0-9-]+: /) {
+ $haveFooter++;
+ next;
+ }
+ next if /^[ []/;
+ $startFooter = $line if ($haveFooter && /^\r?$/);
+ last;
+ }
+
+ @footer = @message[$startFooter+1.. at message];
+ @message = @message[0..$startFooter];
+ push(@footer, "") unless @footer;
+
+ for ($line = 0; $line < @footer; $line++) {
+ $_ = $footer[$line];
+ next if /^($CHANGE_ID_AFTER):/i;
+ last;
+ }
+ splice(@footer, $line, 0, "Change-Id: I$id");
+
+ $_ = join("\n", @message, @footer);
+ open(O, ">$MSG"); print O; close O;
+ ' "$MSG" "$id" "$CHANGE_ID_AFTER"
+}
+_gen_ChangeIdInput() {
+ echo "tree `git write-tree`"
+ if parent=`git rev-parse HEAD^0 2>/dev/null`
+ then
+ echo "parent $parent"
+ fi
+ echo "author `git var GIT_AUTHOR_IDENT`"
+ echo "committer `git var GIT_COMMITTER_IDENT`"
+ echo
+ printf '%s' "$clean_message"
+}
+_gen_ChangeId() {
+ _gen_ChangeIdInput |
+ git hash-object -t commit --stdin
+}
+
+
+add_ChangeId
+#------------------ copied gerrit commit-msg hook to handle ChangeId <--
+
+
+exit 0
diff --git a/.git-hooks/post-merge b/.git-hooks/post-merge
new file mode 100755
index 0000000..25e62ed
--- /dev/null
+++ b/.git-hooks/post-merge
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# Do not warn if there were no real merge
+git rev-parse -q --verify HEAD^2 >/dev/null || exit
+
+echo
+echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
+echo "! You probably used 'git pull' instead of 'git pull -r' !"
+echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
+echo
+echo "You can still fix it - please do 'git pull -r' now."
+echo
diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit
new file mode 100755
index 0000000..5b752a3
--- /dev/null
+++ b/.git-hooks/pre-commit
@@ -0,0 +1,135 @@
+#!/usr/bin/env perl
+
+# A hook script to verify what is about to be committed.
+# Called by "git commit" with no arguments. The hook should
+# exit with non-zero status after issuing an appropriate message
+# if it wants to stop the commit.
+
+use strict;
+#use File::Copy;
+#use Cwd;
+
+$ENV{LC_ALL} = "C";
+
+sub check_whitespaces($)
+{
+ my ($h) = @_;
+ my $src_limited = "c|cpp|cxx|h|hrc|hxx|idl|inl|java|map|MK|pmk|pl|pm|sdi|sh|src|tab|xcu|xml";
+ my $src_full = "c|cpp|cxx|h|hrc|hxx|idl|inl|java|map|mk|MK|pmk|pl|pm|sdi|sh|src|tab|xcu|xml";
+
+ my $found_bad = 0;
+ my $filename;
+ my $reported_filename = "";
+ my $lineno;
+ sub bad_line
+ {
+ my ($why, $line, $file_filter) = @_;
+ if (!defined $file_filter || $filename =~ /\.($file_filter)$/)
+ {
+ if (!$found_bad)
+ {
+ print STDERR "*\n";
+ print STDERR "* You have some suspicious patch lines:\n";
+ print STDERR "*\n";
+ $found_bad = 1;
+ }
+ if ($reported_filename ne $filename)
+ {
+ print STDERR "* In $filename\n";
+ $reported_filename = $filename;
+ }
+ print STDERR "* $why (line $lineno)\n";
+ print STDERR "$filename:$lineno:$line\n";
+ }
+ }
+ open( FILES, "git-diff-index -p -M --cached $h |" ) || die "Cannot run git diff-index.";
+ while (<FILES>)
+ {
+ if (m|^diff --git a/(.*) b/\1$|)
+ {
+ $filename = $1;
+ next;
+ }
+ if (/^@@ -\S+ \+(\d+)/)
+ {
+ $lineno = $1 - 1;
+ next;
+ }
+ if (/^ /)
+ {
+ $lineno++;
+ next;
+ }
+ if (s/^\+//)
+ {
+ $lineno++;
+ chomp;
+ if (/\s$/)
+ {
+ bad_line("trailing whitespace", $_ , $src_limited);
+ }
+ if (/\s* /)
+ {
+ bad_line("indent with Tab", $_, $src_limited);
+ }
+ if (/^(?:[<>=]){7}$/)
+ {
+ bad_line("unresolved merge conflict", $src_full);
+ }
+ if (/SAL_DEBUG/)
+ {
+ bad_line("temporary debug in commit", $_, $src_limited);
+ }
+ }
+ }
+ if ( $found_bad)
+ {
+ exit($found_bad);
+ }
+}
+
+# Do the work :-)
+
+# Initial commit: diff against an empty tree object
+my $against="4b825dc642cb6eb9a060e54bf8d69288fbee4904";
+if ( system( "git rev-parse --verify HEAD >/dev/null 2>&1" ) == 0 )
+{
+ $against="HEAD"
+}
+
+# If you want to allow non-ascii filenames set this variable to true.
+my $allownonascii=`git config hooks.allownonascii`;
+
+# Cross platform projects tend to avoid non-ascii filenames; prevent
+# them from being added to the repository. We exploit the fact that the
+# printable range starts at the space character and ends with tilde.
+if ( $allownonascii ne "true" &&
+ # Note that the use of brackets around a tr range is ok here, (it's
+ # even required, for portability to Solaris 10's /usr/bin/tr), since
+ # the square bracket bytes happen to fall in the designated range.
+ `git diff --cached --name-only --diff-filter=A -z $against | \
+ LC_ALL=C tr -d '[ -~]\\0'` ne "" )
+{
+ print <<EOM;
+Error: Attempt to add a non-ascii file name.
+
+This can cause problems if you want to work
+with people on other platforms.
+
+To be portable it is advisable to rename the file ...
+
+If you know what you are doing you can disable this
+check using:
+
+ git config hooks.allownonascii true
+
+EOM
+ exit( 1 );
+}
+
+# fix whitespace in code
+check_whitespaces( $against);
+
+# all OK
+exit( 0 );
+# vi:set shiftwidth=4 expandtab:
diff --git a/.gitignore b/.gitignore
index eab21d9..c7eda8b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -101,12 +101,6 @@ TAGS
/external/*/*.msm
/moz/zipped/*.zip
-# links to the other repositories
-/binfilter
-/dictionaries
-/helpcontent2
-/translations
-
# compiled python objects for gdb pretty printers
/solenv/gdb/libreoffice/*.py[co]
/solenv/gdb/libreoffice/util/*.py[co]
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..f44a16d
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,16 @@
+[submodule "binfilter"]
+ path = binfilter
+ url = git://gerrit.libreoffice.org/binfilter
+ revision = .
+[submodule "dictionaries"]
+ path = dictionaries
+ url = git://gerrit.libreoffice.org/dictionaries
+ revision = .
+[submodule "helpcontent2"]
+ path = helpcontent2
+ url = git://gerrit.libreoffice.org/help
+ revision = .
+[submodule "translations"]
+ path = translations
+ url = git://gerrit.libreoffice.org/translations
+ revision = .
diff --git a/bin/create_bootstrap_links b/bin/create_bootstrap_links
index a42f7b8..df813b2 100755
--- a/bin/create_bootstrap_links
+++ b/bin/create_bootstrap_links
@@ -1,15 +1,17 @@
#!/usr/bin/env bash
-BIN_DIR=$(dirname $0)
-REPOS=$(cat ${BIN_DIR?}/repo-list)
-cd ${BIN_DIR?}/..
-BOOTSTRAP_DIR=$(pwd)
+# with submodules we do not need links anymore
-for repo in $REPOS ; do
- for link in $(ls clone/${repo}) ; do
- if [ ! -e "$link" ] ; then
- echo "Creating missing link $link"
- ln -s "clone/${repo}/$link" "$link"
- fi
- done
-done
+#BIN_DIR=$(dirname $0)
+#REPOS=$(cat ${BIN_DIR?}/repo-list)
+#cd ${BIN_DIR?}/..
+#BOOTSTRAP_DIR=$(pwd)
+
+#for repo in $REPOS ; do
+# for link in $(ls clone/${repo}) ; do
+# if [ ! -e "$link" ] ; then
+# echo "Creating missing link $link"
+# ln -s "clone/${repo}/$link" "$link"
+# fi
+# done
+#done
diff --git a/binfilter b/binfilter
new file mode 160000
index 0000000..6501eb7
--- /dev/null
+++ b/binfilter
@@ -0,0 +1 @@
+Subproject commit 6501eb7a7f6ab7dba2223a5b8a721290ef1be627
diff --git a/config_host.mk.in b/config_host.mk.in
index 8787a2e..2c46a6c 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -192,6 +192,7 @@ export GCONF_LIBS=@GCONF_LIBS@
export GIO_CFLAGS=@GIO_CFLAGS@
export GIO_LIBS=@GIO_LIBS@
export GIT_LINK_SRC=@GIT_LINK_SRC@
+export GIT_NEEDED_SUBMODULES=@GIT_NEEDED_SUBMODULES@
export GIT_REPO_NAMES=@GIT_REPO_NAMES@
export GLIB_CFLAGS=@GLIB_CFLAGS@
export GLIB_LIBS=@GLIB_LIBS@
diff --git a/configure.in b/configure.in
index 9906ead..9f15c97 100644
--- a/configure.in
+++ b/configure.in
@@ -11,6 +11,7 @@ save_CXX=$CXX
BUILD_TYPE="LibO"
SCPDEFS=""
GIT_REPO_NAMES=""
+GIT_NEEDED_SUBMODULES=""
LO_PATH= # used by path_munge to construct a PATH variable
PathFormat()
@@ -4347,6 +4348,7 @@ else
WITH_BINFILTER="YES"
BUILD_TYPE="$BUILD_TYPE BINFILTER"
GIT_REPO_NAMES="$GIT_REPO_NAMES binfilter"
+ GIT_NEEDED_SUBMODULES="binfilter $GIT_NEEDED_SUBMODULES"
AC_MSG_RESULT([yes])
fi
AC_SUBST(WITH_BINFILTER)
@@ -4357,6 +4359,7 @@ if test "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
BUILD_TYPE="$BUILD_TYPE HELP"
SCPDEFS="$SCPDEFS -DWITH_HELP"
GIT_REPO_NAMES="$GIT_REPO_NAMES help"
+ GIT_NEEDED_SUBMODULES="helcontent2 $GIT_NEEDED_SUBMODULES"
else
AC_MSG_RESULT([no])
fi
@@ -4369,6 +4372,7 @@ if test -z "$with_myspell_dicts" -o "$with_myspell_dicts" = "yes"; then
WITH_MYSPELL_DICTS=YES
BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
GIT_REPO_NAMES="$GIT_REPO_NAMES dictionaries"
+ GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
else
AC_MSG_RESULT([no])
WITH_MYSPELL_DICTS=NO
@@ -12185,6 +12189,7 @@ if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
else
AC_MSG_RESULT([$WITH_LANG])
GIT_REPO_NAMES="$GIT_REPO_NAMES translations"
+ GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
fi
# check that the list is valid
for lang in $WITH_LANG; do
@@ -12210,6 +12215,7 @@ AC_SUBST(ALL_LANGS)
AC_SUBST(WITH_LANG)
AC_SUBST(WITH_LANG_LIST)
AC_SUBST(GIT_REPO_NAMES)
+AC_SUBST(GIT_NEEDED_SUBMODULES)
PathFormat "$SRC_ROOT/translations"
diff --git a/dictionaries b/dictionaries
new file mode 160000
index 0000000..19dba71
--- /dev/null
+++ b/dictionaries
@@ -0,0 +1 @@
+Subproject commit 19dba715c843961a18bbc8871373e33be165c4ab
diff --git a/download b/download
index 9674bfc..0dc1d0f 100755
--- a/download
+++ b/download
@@ -52,17 +52,19 @@ if [ -d .git ] ; then
if [ -z "$GIT_LINK_SRC" ]; then
./g -f clone
else
+ echo "FIXME: GIT_LINK_SRC method is not yet implemented with submodules" 1>&2
+ exit 1;
# space-saving clone from another local workdir
- mkdir clone
- branch=$(git symbolic-ref HEAD | cut -d"/" -f 3)
- for i in $GIT_REPO_NAMES ; do
- bin/git-new-workdir $GIT_LINK_SRC/$i clone/$i $branch
- for d in clone/$i/* ; do
- if [ "${d}" != "clone/$i/git-hooks" ]; then
- ln -sfn ${d} $(basename ${d})
- fi
- done
- done
+# mkdir clone
+# branch=$(git symbolic-ref HEAD | cut -d"/" -f 3)
+# for i in $GIT_REPO_NAMES ; do
+# bin/git-new-workdir $GIT_LINK_SRC/$i clone/$i $branch
+# for d in clone/$i/* ; do
+# if [ "${d}" != "clone/$i/git-hooks" ]; then
+# ln -sfn ${d} $(basename ${d})
+# fi
+# done
+# done
fi
fi
@@ -169,7 +171,7 @@ for i in $filelist ; do
# echo $i
if [ "$i" != `echo $i | sed "s/^http:\///"` ]; then
tarurl=$i
- # TODO: check for comment
+ # TODO: check for comment
else
if [ "$tarurl" != "" ]; then
sum=`echo $i | sed "s/-.*//"`
diff --git a/g b/g
index a82fc31..d73b8a6 100755
--- a/g
+++ b/g
@@ -3,116 +3,207 @@
# Wrapper for git to handle more subdirs at the same time
#
-# no params, no action
-if [ "$#" -eq "0" ] ; then
- git
- echo
- echo "Additional options available only in this 'g' wrapper:"
- echo
- echo "Usage: g [options] [git commands]"
- echo " -f Force - act on all the repos, not only the changed ones"
- echo " -s Silent - do not report the repo names."
- echo " -v Verbose - Print git commands."
- echo " -1 report the repos name on the first line of the output as <repo>:"
- echo " -z just to some house cleaning (hooks mostly). this is a stand-alone option as in ./g -z"
- echo " --set-push-user [username] re-write an existing tree's config with an fd.o commit account name"
- echo " --last-working checks out the last known working build (useful for windows)";
- echo " --set-last-working adds a note denoting a working build";
- echo " --push-notes pushes all notes";
- exit $?
+if [ -n "$g_debug" ] ; then
+ set -x
fi
-if [ ! "`type -p git`" ]; then
- echo "Cannot find the git binary! Is git installed and is in PATH?"
- exit 1
-fi
+SUBMODULES_ALL="binfilter dictionaries helpcontent2 translations"
pushd $(dirname $0) > /dev/null
COREDIR=$(pwd)
popd > /dev/null
-if test -f $COREDIR/bin/repo-list
-then
- ALLREPOS="core `cat "$COREDIR/bin/repo-list"`"
-else
- ALLREPOS=core
-fi
+usage()
+{
+ git
+ echo
+ echo "Usage: g [options] [git (checkout|clone|fetch|grep|pull|push|reset) [git options/args..]]"
+ echo ""
+ echo " -z restaure the git hooks and others sanity checks"
+}
-refresh_hooks()
+refresh_submodule_hooks()
{
- 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" ] ; then
- rm -f "$hook"
- ln -sf "$COREDIR/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"
- if [ ! -x "$hook" ] ; then
- rm -f "$hook"
- ln -sf "$COREDIR/clone/translations/git-hooks/$hook_name" "$hook"
- fi
- done
- # .gitattribute should be per-repo, avoid entangling repos
- if [ -L .gitattributes ] ; then
- rm -f .gitattributes
- fi
- popd > /dev/null
- fi
- ;;
- binfilter|help|dictionaries)
- if [ -d $COREDIR/clone/$repo ] ; then
- pushd $COREDIR/clone/$repo > /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"
- if [ ! -x "$hook" ] ; then
- rm -f "$hook"
- ln -sf "$COREDIR/git-hooks/$hook_name" "$hook"
- fi
- done
- # .gitattribute should be per-repo, avoid entangling repos
- if [ -L .gitattributes ] ; then
- rm -f .gitattributes
- fi
- popd > /dev/null
+local repo=$1
+local hook
+local hook_name
+
+ if [ -d ${repo?}/.git ] ; then
+ # use core's hook by default
+ for hook_name in $(ls -1 ${COREDIR?}/.git-hooks) ; do
+ hook="${repo?}/.git/hooks/${hook_name?}"
+ if [ ! -e "${hook?}" -o -L "${hook?}" ] ; then
+ rm -f "${hook?}"
+ ln -sf "${COREDIR?}/.git-hooks/${hook_name?}" "${hook?}"
fi
- ;;
- esac
+ done
+ # override if need be by the submodules' own hooks
+ for hook_name in $(ls -1 ${COREDIR?}/${repo?}/.git-hooks 2>/dev/null) ; do
+ hook="${repo?}/.git/hooks/${hook_name?}"
+ if [ ! -e "${hook?}" -o -L "${hook?}" ] ; then
+ rm -f "${hook?}"
+ ln -sf "${COREDIR?}/${repo?}/.git-hooks/${hook_name?}" "${hook?}"
+ fi
+ done
+ fi
}
refresh_all_hooks()
{
- repos="$ALLREPOS"
- for repo in $repos ; do
- refresh_hooks $repo
+local repo
+local hook_name
+local hook
+
+ pushd ${COREDIR?} > /dev/null
+ for hook_name in $(ls -1 ${COREDIR?}/.git-hooks) ; do
+ hook=".git/hooks/${hook_name?}"
+ if [ ! -e "${hook?}" -o -L "${hook?}" ] ; then
+ rm -f "${hook?}"
+ ln -sf "${COREDIR?}/.git-hooks/${hook_name?}" "${hook?}"
+ fi
+ done
+
+ for repo in ${SUBMODULES_ALL?} ; do
+ refresh_submodule_hooks $repo
+ done
+ popd > /dev/null
+
+}
+
+set_push_url()
+{
+local repo
+
+ repo="$1"
+ if [ -n "$repo" ] ; then
+ pushd "${COREDIR?}/${repo?}" > /dev/null
+ else
+ pushd "${COREDIR?}" > /dev/null
+ repo="core"
+ fi
+ echo "setting up push url for ${repo?}"
+ if [ "${repo?}" = "helpcontent2" ] ; then
+ git config remote.origin.pushurl "ssh://${PUSH_USER}gerrit.libreoffice.org:29418/help"
+ else
+ git config remote.origin.pushurl "ssh://${PUSH_USER}gerrit.libreoffice.org:29418/${repo?}"
+ fi
+ popd > /dev/null
+}
+
+set_push_urls()
+{
+ PUSH_USER="$1"
+ if [ -n "$PUSH_USER" ] ; then
+ PUSH_USER="${PUSH_USER}@"
+ fi
+ set_push_url
+ for repo in ${SUBMODULES_ACTIVE?} ; do
+ set_push_url "${repo?}"
+ done
+}
+
+get_active_submodules()
+{
+SUBMODULES_ACTIVE=""
+local repo
+
+ for repo in ${SUBMODULES_ALL?} ; do
+ if [ -d ${repo?}/.git ] ; then
+ SUBMODULES_ACTIVE="${repo?} ${SUBMODULES_ACTIVE?}"
+ fi
done
}
-postprocess()
+get_configured_submodules()
{
- rc=$1
- if $DO_HOOK_REFRESH ; then
- refresh_all_hooks
+ SUBMODULES_CONFIGURED=""
+ if [ -f "config_host.mk" ] ; then
+ SUBMODULES_CONFIGURED=$(cat config_host.mk | grep GIT_NEEDED_SUBMODULES | sed -e "s/.*=//")
+ else
+ # if we need the configured submoduel before the configuration is done. we assumed you want them all
+ SUBMODULES_CONFIGURED=${SUBMODULES_ALL?}
fi
+}
+
+do_git_cmd()
+{
+ echo "cmd:$@"
+ git "$@"
+ git submodule foreach git "$@" $KEEP_GOING
+}
+
+do_checkout()
+{
+local cmd
+local create_branch="0"
+local branch
+
+ git checkout "$@" || return $?
+ for cmd in "$@" ; do
+ if [ "$cmd" = "-f" ]; then
+ return 0
+ elif [ "$cmd" = "-b" ] ; then
+ create_branch=1
+ elif [ "$create_branch" = "1" ] ; then
+ branch="$arg"
+ fi
+ done
+ if [ -f .gitmodules ] ; then
+ if [ -n "$branch" ] ; then
+ git submodules foreach git branch ${branch} HEAD || return $?
+ fi
+ else
+ # now that is the nasty case we moved prior to submodules
+ # make sure we have the needed repo in clone
+ ./g clone && ./g -f checkout "$@" || return $?
+ fi
+ return $?
+}
+
+do_reset()
+{
+ git reset "$@" || return $?
+ if [ -f .gitmodules ] ; then
+ git submodule update || return $?
+ else
+ # now that is the nasty case we moved prior to submodules
+ # make sure we have the needed repo in clone
+ ./g clone && ./g -f reset "$@"
+ fi
+ return $?;
+}
+
+do_init_modules()
+{
+local module
+local configured
- exit $rc;
+ for module in $SUBMODULES_CONFIGURED ; do
+ configured=$(git config --local --get submodule.${module}.url)
+ if [ -z "$configured" ] ; then
+ git submodule init $module || return $?
+ fi
+ done
+ return 0
}
-CLONEDIR="$COREDIR/clone"
-if [ ! -e ${CLONEDIR} ]; then mkdir -p "$CLONEDIR"; fi
+
+# no params, no action
+if [ "$#" -eq "0" ] ; then
+ usage
+fi
+
+if [ ! "`type -p git`" ]; then
+ echo "Cannot find the git binary! Is git installed and is in PATH?"
+ exit 1
+fi
+
+
+get_active_submodules
+get_configured_submodules
+
+
+
# extra params for some commands, like log
EXTRA=
@@ -125,7 +216,7 @@ PUSH_NOTES=
LAST_WORKING=
SET_LAST_WORKING=
ALLOW_EMPTY=
-KEEP_GOING=0
+KEEP_GOING=
REPORT_REPOS=1
REPORT_COMMANDS=0
REPORT_COMPACT=0
@@ -133,289 +224,67 @@ DO_HOOK_REFRESH=false
while [ "${COMMAND:0:1}" = "-" ] ; do
case "$COMMAND" in
- -f) KEEP_GOING=1
- ;;
- -s) REPORT_REPOS=0
- ;;
- -v) REPORT_COMMANDS=1
- ;;
- -1) REPORT_COMPACT=1
- ;;
- --set-push-user)
- shift
- PUSH_USER="$1"
- ;;
- --last-working) LAST_WORKING=1
- ;;
- --set-last-working) SET_LAST_WORKING=1
- ;;
- --push-notes) PUSH_NOTES=1
+ -f )KEEP_GOING="||:"
;;
-z)
- DO_HOOK_REFRESH=true
- postprocess 0
+ refresh_all_hooks
+ exit 0;
;;
+ --set-push-urls)
+ shift
+ PUSH_USER="$1"
+ if [ -n "${PUSH_USER}" ] ; then
+ PUSH_USER="${PUSH_USER}@"
+ fi
+ set_push_urls
+ exit 0;
+ ;;
+ -*)
+ echo "option: $COMMAND not supported" 1>&2
+ exit 1
esac
shift
COMMAND="$1"
done
+shift
+
case "$COMMAND" in
- apply)
- 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
- ;;
- log)
- if [ "$#" = "1" ] ; then
- EXTRA='-1'
- fi
- PAGER='--no-pager'
+ branch)
+ do_git_cmd ${COMMAND} "$@"
+ ;;
+ checkout)
+ do_checkout "$@" && git submodule foreach git checkout "$@"
+ ;;
+ clone)
+ do_init_modules && git submodule update && refresh_all_hooks
;;
+ fetch)
+ (git fetch "$@" && git submodule foreach git fetch "$@" ) && git submodule update
+
+ ;;
+ grep)
+ KEEP_GOING="||:"
+ do_git_cmd ${COMMAND} "$@"
+ ;;
+ pull)
+ git pull "$@" && git submodule update && refresh_all_hooks
+ ;;
push)
- if [ "$#" != "1" ] ; then
- PUSH_ALL=1
- fi
+ git submodule foreach git push "$@"
+ if [ "$?" = "0" ] ; then
+ git push "$@"
+ fi
+ ;;
+ reset)
+ do_reset
+ ;;
+ *)
+ echo "./g does not support command:$COMMAND" 1>&2
+ exit 1;
;;
esac
-# absolutize the parameters first
-unset FILES
-FILESNUM=0
-while shift ; do
- PARAM="$1"
- if [ -z "$PARAM" ] ; then
- continue
- elif [ "${PARAM:0:1}" = "-" ] ; then
- if [ \( "$COMMAND" = "checkout" -a "$PARAM" = "-b" \) -o \
- \( "$COMMAND" = "clone" -a "$PARAM" = "--reference" \) -o \
- \( "$COMMAND" = "commit" -a "$PARAM" = "-m" \) -o \
- \( "$COMMAND" = "commit" -a "$PARAM" = "-am" \) -o \
- \( "$COMMAND" = "tag" -a "$PARAM" = "-m" \) ]
- then
- # params that take an argument
- FILES[$FILESNUM]="$PARAM"
- FILESNUM=$(($FILESNUM+1))
- shift
- FILES[$FILESNUM]="$1"
- FILESNUM=$(($FILESNUM+1))
- else
- if [ "$COMMAND" = "commit" -a "$PARAM" = "-F" ]
- then
- shift
- # this still needs some magic to handle relative paths
- EXTRA="${EXTRA} -F ${1}"
- else
- [ "$COMMAND" = "commit" -a "$PARAM" = "--allow-empty" ] && ALLOW_EMPTY=1
- FILES[$FILESNUM]="$PARAM"
- FILESNUM=$(($FILESNUM+1))
- fi
- fi
- else
- if [ "$COMMAND" = "apply" ] ; then
- grep -qs $'^+ *\t' "$PARAM" && {
- echo "Patch '$PARAM' introduces tabs in indentation, aborting."
- echo
- echo "Please fix the patch (something like s/^\(+ *\)\t/\1 /) and try again."
- echo
- exit 1
- }
- fi
- if [ "$COMMAND" == "rev-parse" ] ; then
- # this is not a file
- FILES[$FILESNUM]="$PARAM"
- FILESNUM=$(($FILESNUM+1))
- else
- # make the paths absolute
- FILES[$FILESNUM]=$(perl -e 'use Cwd "abs_path"; print abs_path(shift);' "$PARAM" 2>/dev/null)
- if [ -z "${FILES[$FILESNUM]}" -o ! -e "${FILES[$FILESNUM]}" ] ; then
- # it is probably not a file, but a tag name, or something
- FILES[$FILESNUM]="$PARAM"
- fi
- FILESNUM=$(($FILESNUM+1))
- fi
- fi
-done
-
-# do it!
-DIRS="core $(cd $CLONEDIR ; ls)"
-if [ "$COMMAND" = "clone" ] ; then
- DIRS="$ALLREPOS"
-fi
-for REPO in $DIRS ; do
- DIR="$CLONEDIR/$REPO"
- NAME="$REPO"
- if [ "$REPO" = "core" ] ; then
- DIR="$COREDIR"
- NAME="main repo"
- fi
-
- if [ -d "$DIR" -a "z$PUSH_USER" != "z" ]; then
- echo "setting up push url for $DIR"
- (cd $DIR && git config remote.origin.pushurl "ssh://${PUSH_USER}@gerrit.libreoffice.org:29418/${REPO}")
- elif [ -d "$DIR" -a "z$LAST_WORKING" != "z" ]; then
- echo "fetching notes for $REPO ..."
- (cd $DIR && git fetch origin 'refs/notes/*:refs/notes/*')
- hash=`(cd $DIR && git log --pretty='%H %N' | grep 'win32 working build' | head -n1 | sed 's/ win32.*//')`
- if test "z$hash" != "z"; then
- echo "update to $hash"
- (cd $DIR && git checkout $hash)
- else
- echo "Warning: missing known working note on repo $REPO"
- fi
- elif [ -d "$DIR" -a "z$SET_LAST_WORKING" != "z" ]; then
- echo "fetching notes for $REPO ..."
- (cd $DIR && git fetch origin 'refs/notes/*:refs/notes/*')
- (cd $DIR && git notes add -m 'win32 working build')
- elif [ -d "$DIR" -a "z$PUSH_NOTES" != "z" ]; then
- echo "pushing notes for $REPO ..."
- (cd $DIR && git push origin 'refs/notes/*:refs/notes/*')
- elif [ \( -d "$DIR" -a -d "$DIR"/.git \) -o \( "$COMMAND" = "clone" \) ] ; then
- (
- # executed in a subshell
- if [ "$COMMAND" != "clone" ] ; then
- cd "$DIR"
- else
- cd "$CLONEDIR"
- fi
-
- # relativize the absolutized params again if we want to operate
- # only on the files belonging to this exact repo
- if [ "$RELATIVIZE" = "1" -a -n "$FILES" ] ; then
- FILESNUM=0
- INSERTNUM=0
- PWD=$(pwd)
- PWDLEN=$(pwd | wc -c)
- for I in "${FILES[@]}" ; do
- I="${I//@REPO@/${REPO}}"
- unset FILES[$FILESNUM]
- FILESNUM=$(($FILESNUM+1))
- # filter out files that don't belong to this repo
- if [ \( "${I:0:1}" = "/" \) -a \( "$COMMAND" != "clone" \) ] ; then
- if [ "${I:0:$PWDLEN}" = "$PWD/" ] ; then
- FILES[$INSERTNUM]="${I:$PWDLEN}"
- INSERTNUM=$(($INSERTNUM+1))
- fi
- else
- FILES[$INSERTNUM]="$I"
- INSERTNUM=$(($INSERTNUM+1))
- fi
- done
- [ "$INSERTNUM" = "0" ] && exit 0
- fi
-
- # some extra params
- case "$COMMAND" in
- apply)
- for I in * ; do
- if [ -d "$I" ] ; then
- EXTRA="$EXTRA --include=$I/*"
- else
- EXTRA="$EXTRA --include=$I"
- fi
- done
- ;;
- commit)
- if [ "$ALLOW_EMPTY" != "1" ] ; then
- [ -z "$(git diff-index --name-only HEAD --)" ] && exit 0
- fi
- ;;
- push)
- if [ "$PUSH_ALL" != "1" ] ; then
- [ -n "$(git rev-list @{upstream}..HEAD)" ] || exit 0
- fi
- ;;
- status)
- LOCALCOMMITS="$(git rev-list @{upstream}..HEAD)"
- if [ -z "$LOCALCOMMITS" ] ; then
- [ -z "$(git diff-index --name-only HEAD --)" ] && exit 0
- fi
- ;;
- clone)
- EXTRA="$(git config remote.origin.url)"
- EXTRA=${EXTRA/core/${REPO}}
- ;;
- esac
-
- # do it!
- if [ "$COMMAND" != "clone" -o ! -d $DIR ] ; then
- if [ "$REPORT_REPOS" = "1" -a "$COMMAND" != "grep" ] ; then
- if [ "$REPORT_COMPACT" = "1" ] ; then
- echo -n "${REPO}:"
- else
- echo "===== $NAME ====="
- fi
- fi
- if [ "$REPORT_COMMANDS" = "1" ] ; then
- echo "+ git $PAGER $COMMAND $EXTRA ${FILES[@]}"
- fi
- git $PAGER "$COMMAND" $EXTRA "${FILES[@]}"
- RETURN=$?
- fi
-
- # now we can change the dir in case of clone as well
- if [ "$COMMAND" = "clone" ] ; then
- cd $DIR
- fi
-
- case "$COMMAND" in
- pull|clone)
- # update links
- if [ "$DIR" != "$COREDIR" ]; then
- for link in $(ls) ; do
- if [ ! -e "$COREDIR/$link" ] ; then
- if test -h "$COREDIR/$link"; then
- rm "$COREDIR/$link"
- echo -n "re-"
- fi
- echo "creating missing link $link"
- ln -s "$DIR/$link" "$COREDIR/$link"
- fi
- done
- fi
- ;;
- status)
- # git status returns error in some versions, clear that
- RETURN=0
- ;;
- grep)
- # git grep return an 'error' if nothing is found
- # still we should continue grepping the other repos
- RETURN=0
- ;;
- esac
- if [ "$KEEP_GOING" = "1" ] ; then
- RETURN=0
- fi
-
- exit $RETURN
- ) || postprocess $?
- fi
-done
-
-# Cleanup the broken links
-if [ "$COMMAND" = "pull" ] ; then
- for link in $(ls $COREDIR) ; do
- if [ -h "$COREDIR/$link" -a ! -e "$COREDIR/$link" ]; then
- echo "Removing broken link $link"
- rm $COREDIR/$link
- fi
- done
-fi
-
-# warn
-if [ "$COMMAND" = "apply" ] ; then
- echo
- echo "Don't forget to check the status & commit now ;-)"
- echo
-fi
-
-postprocess $?
+exit $?
# vi:set shiftwidth=4 expandtab:
diff --git a/git-hooks/commit-msg b/git-hooks/commit-msg
deleted file mode 100755
index fa0b2e2..0000000
--- a/git-hooks/commit-msg
+++ /dev/null
@@ -1,173 +0,0 @@
-#!/bin/sh
-#
-# An example hook script to check the commit log message.
-# Called by git-commit with one argument, the name of the file
-# that has the commit message. The hook should exit with non-zero
-# status after issuing an appropriate message if it wants to stop the
-# commit. The hook is allowed to edit the commit message file.
-#
-# To enable this hook, make this file executable.
-
-# Uncomment the below to add a Signed-off-by line to the message.
-# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
-# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
-
-# This example catches duplicate Signed-off-by lines.
-
-base_dir=$(dirname $0)
-MSG="$1"
-
-abort() {
- cp $1 $1.save
- cat >&2 <<EOF
-Commit aborted, your commit message was saved as '$1.save'.
-
-Reason: $2
-
-EOF
- exit 1
-}
-
-test "" = "$(grep '^Signed-off-by: ' "$1" |
- sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
- abort "$1" "Duplicate Signed-off-by lines."
-}
-
-# Check that the first line exists, and is not an asterisk
-
-if [ -z "`head -n 1 $1 | grep -v '^[ \t]*\*$'`" ] ; then
- abort "$1" "Please provide the general description on the first line."
-fi
-
-# ...and that it is not too long
-
-if [ "`head -n 1 $1 | wc -c`" -gt 79 ] ; then
- abort "$1" "The first line is too long, please try to fit into 79 characters."
-fi
-
-# ...and that it does not continue on the second line
-if [ "`wc -l < $1`" -gt 1 -a -n "`head -n 2 $1 | tail -n 1 | sed 's/^#.*//'`" ] ; then
- abort "$1" "The second line is not empty - maybe the first line continues there?"
-fi
-
-# Check that the message is not a ChangeLog-like one
-
-if [ -n "`head -n 1 $1 | grep '^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.*<.*@.*>'`" ] ; then
- abort "$1" "The commit message looks like ChangeLog, please use the git form."
-fi
-
-# Check for whitespace in front of *'s
-
-if [ -n "`sed '/^#/,$d' $1 | grep '^[[:space:]]\+\*.*:'`" -a -z "`grep '^\*' $1`" ] ; then
- abort "$1" "Please don't use whitespace in front of '* file: Description.' entries."
-fi
-
-#------------------ copied gerrit commit-msg hook to handle ChangeId -->
-# From Gerrit Code Review 2.3
-#
-# Part of Gerrit Code Review (http://code.google.com/p/gerrit/)
-#
-# Copyright (C) 2009 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-CHANGE_ID_AFTER="Bug|Issue"
-
-# Check for, and add if missing, a unique Change-Id
-#
-add_ChangeId() {
- clean_message=`sed -e '
- /^diff --git a\/.*/{
- s///
- q
- }
- /^Signed-off-by:/d
- /^#/d
- ' "$MSG" | git stripspace`
- if test -z "$clean_message"
- then
- return
- fi
-
- id=`grep -i '^Change-Id:' "$MSG" | sed -e "s/.*: I//"`
- temp_msg=`grep -v -i '^Change-Id:' "$MSG"`
- echo "$temp_msg" > "$MSG"
-
- if test -z "$id"
- then
- id=`_gen_ChangeId`
- fi
- perl -e '
- $MSG = shift;
- $id = shift;
- $CHANGE_ID_AFTER = shift;
-
- undef $/;
- open(I, $MSG); $_ = <I>; close I;
- s|^diff --git a/.*||ms;
- s|^#.*$||mg;
- exit unless $_;
-
- @message = split /\n/;
- $haveFooter = 0;
- $startFooter = @message;
- for($line = @message - 1; $line >= 0; $line--) {
- $_ = $message[$line];
-
- if (/^[a-zA-Z0-9-]+: /) {
- $haveFooter++;
- next;
- }
- next if /^[ []/;
- $startFooter = $line if ($haveFooter && /^\r?$/);
- last;
- }
-
- @footer = @message[$startFooter+1.. at message];
- @message = @message[0..$startFooter];
- push(@footer, "") unless @footer;
-
- for ($line = 0; $line < @footer; $line++) {
- $_ = $footer[$line];
- next if /^($CHANGE_ID_AFTER):/i;
- last;
- }
- splice(@footer, $line, 0, "Change-Id: I$id");
-
- $_ = join("\n", @message, @footer);
- open(O, ">$MSG"); print O; close O;
- ' "$MSG" "$id" "$CHANGE_ID_AFTER"
-}
-_gen_ChangeIdInput() {
- echo "tree `git write-tree`"
- if parent=`git rev-parse HEAD^0 2>/dev/null`
- then
- echo "parent $parent"
- fi
- echo "author `git var GIT_AUTHOR_IDENT`"
- echo "committer `git var GIT_COMMITTER_IDENT`"
- echo
- printf '%s' "$clean_message"
-}
-_gen_ChangeId() {
- _gen_ChangeIdInput |
- git hash-object -t commit --stdin
-}
-
-
-add_ChangeId
-#------------------ copied gerrit commit-msg hook to handle ChangeId <--
-
-
-exit 0
diff --git a/git-hooks/post-merge b/git-hooks/post-merge
deleted file mode 100755
index 25e62ed..0000000
--- a/git-hooks/post-merge
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-# Do not warn if there were no real merge
-git rev-parse -q --verify HEAD^2 >/dev/null || exit
-
-echo
-echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
-echo "! You probably used 'git pull' instead of 'git pull -r' !"
-echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
-echo
-echo "You can still fix it - please do 'git pull -r' now."
-echo
diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit
deleted file mode 100755
index 5b752a3..0000000
--- a/git-hooks/pre-commit
+++ /dev/null
@@ -1,135 +0,0 @@
-#!/usr/bin/env perl
-
-# A hook script to verify what is about to be committed.
-# Called by "git commit" with no arguments. The hook should
-# exit with non-zero status after issuing an appropriate message
-# if it wants to stop the commit.
-
-use strict;
-#use File::Copy;
-#use Cwd;
-
-$ENV{LC_ALL} = "C";
-
-sub check_whitespaces($)
-{
- my ($h) = @_;
- my $src_limited = "c|cpp|cxx|h|hrc|hxx|idl|inl|java|map|MK|pmk|pl|pm|sdi|sh|src|tab|xcu|xml";
- my $src_full = "c|cpp|cxx|h|hrc|hxx|idl|inl|java|map|mk|MK|pmk|pl|pm|sdi|sh|src|tab|xcu|xml";
-
- my $found_bad = 0;
- my $filename;
- my $reported_filename = "";
- my $lineno;
- sub bad_line
- {
- my ($why, $line, $file_filter) = @_;
- if (!defined $file_filter || $filename =~ /\.($file_filter)$/)
- {
- if (!$found_bad)
- {
- print STDERR "*\n";
- print STDERR "* You have some suspicious patch lines:\n";
- print STDERR "*\n";
- $found_bad = 1;
- }
- if ($reported_filename ne $filename)
- {
- print STDERR "* In $filename\n";
- $reported_filename = $filename;
- }
- print STDERR "* $why (line $lineno)\n";
- print STDERR "$filename:$lineno:$line\n";
- }
- }
- open( FILES, "git-diff-index -p -M --cached $h |" ) || die "Cannot run git diff-index.";
- while (<FILES>)
- {
- if (m|^diff --git a/(.*) b/\1$|)
- {
- $filename = $1;
- next;
- }
- if (/^@@ -\S+ \+(\d+)/)
- {
- $lineno = $1 - 1;
- next;
- }
- if (/^ /)
- {
- $lineno++;
- next;
- }
- if (s/^\+//)
- {
- $lineno++;
- chomp;
- if (/\s$/)
- {
- bad_line("trailing whitespace", $_ , $src_limited);
- }
- if (/\s* /)
- {
- bad_line("indent with Tab", $_, $src_limited);
- }
- if (/^(?:[<>=]){7}$/)
- {
- bad_line("unresolved merge conflict", $src_full);
- }
- if (/SAL_DEBUG/)
- {
- bad_line("temporary debug in commit", $_, $src_limited);
- }
- }
- }
- if ( $found_bad)
- {
- exit($found_bad);
- }
-}
-
-# Do the work :-)
-
-# Initial commit: diff against an empty tree object
-my $against="4b825dc642cb6eb9a060e54bf8d69288fbee4904";
-if ( system( "git rev-parse --verify HEAD >/dev/null 2>&1" ) == 0 )
-{
- $against="HEAD"
-}
-
-# If you want to allow non-ascii filenames set this variable to true.
-my $allownonascii=`git config hooks.allownonascii`;
-
-# Cross platform projects tend to avoid non-ascii filenames; prevent
-# them from being added to the repository. We exploit the fact that the
-# printable range starts at the space character and ends with tilde.
-if ( $allownonascii ne "true" &&
- # Note that the use of brackets around a tr range is ok here, (it's
- # even required, for portability to Solaris 10's /usr/bin/tr), since
- # the square bracket bytes happen to fall in the designated range.
- `git diff --cached --name-only --diff-filter=A -z $against | \
- LC_ALL=C tr -d '[ -~]\\0'` ne "" )
-{
- print <<EOM;
-Error: Attempt to add a non-ascii file name.
-
-This can cause problems if you want to work
-with people on other platforms.
-
-To be portable it is advisable to rename the file ...
-
-If you know what you are doing you can disable this
-check using:
-
- git config hooks.allownonascii true
-
-EOM
- exit( 1 );
-}
-
-# fix whitespace in code
-check_whitespaces( $against);
-
-# all OK
-exit( 0 );
-# vi:set shiftwidth=4 expandtab:
diff --git a/helpcontent2 b/helpcontent2
new file mode 160000
index 0000000..4507e5f
--- /dev/null
+++ b/helpcontent2
@@ -0,0 +1 @@
+Subproject commit 4507e5f21836724cf768cf4e3ffbbf4ada6c87c3
diff --git a/translations b/translations
new file mode 160000
index 0000000..751ae9d
--- /dev/null
+++ b/translations
@@ -0,0 +1 @@
+Subproject commit 751ae9de9563da8b26aef8e5c0f80ad502fbfe81
commit 074bb522927c60f2575fdc5bcb83eb17a4dfc4b7
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Tue Oct 16 18:15:19 2012 +0200
RtfFilter::filter: add code to dump input stream for copy&paste
This is especially useful when creating testcases for handling
copy&paste input.
Change-Id: I11be65484e7ac4dfac3d28576249143b7532a976
diff --git a/writerfilter/source/filter/RtfFilter.cxx b/writerfilter/source/filter/RtfFilter.cxx
index 22f7108..35f84da 100644
--- a/writerfilter/source/filter/RtfFilter.cxx
+++ b/writerfilter/source/filter/RtfFilter.cxx
@@ -27,6 +27,11 @@
#include <rtftok/RTFDocument.hxx>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp>
+#ifdef DBG_COPYPASTE
+#include <unotools/localfilehelper.hxx>
+#include <tools/stream.hxx>
+#include <unotools/ucbstreamhelper.hxx>
+#endif
using namespace ::rtl;
using namespace ::cppu;
@@ -82,6 +87,17 @@ sal_Bool RtfFilter::filter( const uno::Sequence< beans::PropertyValue >& aDescri
aMediaDesc.addInputStream();
aMediaDesc[ MediaDescriptor::PROP_INPUTSTREAM() ] >>= xInputStream;
+#ifdef DBG_COPYPASTE
+ OUString aOutStr;
+ if (utl::LocalFileHelper::ConvertPhysicalNameToURL("/tmp/stream.rtf", aOutStr))
+ {
+ SvStream* pOut = utl::UcbStreamHelper::CreateStream(aOutStr, STREAM_WRITE);
+ SvStream* pIn = utl::UcbStreamHelper::CreateStream(xInputStream);
+ *pOut << *pIn;
+ delete pOut;
+ }
+#endif
+
uno::Reference<frame::XFrame> xFrame = aMediaDesc.getUnpackedValueOrDefault(MediaDescriptor::PROP_FRAME(),
uno::Reference<frame::XFrame>());
More information about the Libreoffice-commits
mailing list