gdbus: start importing the complete upstream development history

This commit is contained in:
Patrick Ohly 2009-09-08 15:26:14 +02:00
parent 81be83bb02
commit 9e2521f993
4 changed files with 117 additions and 50 deletions

76
build/import-foreign-git.sh Executable file
View File

@ -0,0 +1,76 @@
#! /bin/sh
#
# Run this inside the top level of a clean
# syncevolution git repository with the following
# parameters:
# - file system path for foreign git repository
# - name of local branch for importing changes
# - a local directory into which the source file(s) is to be placed,
# preserving all remaining directories after stripping
# - number of directory levels to strip from source file(s)
# - one or more source file names, with paths relative to the
# foreign repository
set -e
set -x
FOREIGN="$1"
shift
TARGET_BRANCH="$1"
shift
TARGET_DIR="$1"
shift
SOURCE_LEVELS="$1"
shift
SOURCE="$@"
FOREIGN_NAME=`basename $FOREIGN`
TARGET=`for i in $SOURCE; do echo $i | perl -p -e "s;([^/]*/){$SOURCE_LEVELS};$TARGET_DIR/;"; done`
PATCH=`mktemp`
MSG=`mktemp`
git checkout $TARGET_BRANCH
# find lastest imported commit:
# import everything unless one of the files already exists,
# in which case we assume that all of the others also exist
revisions=master
for i in $TARGET; do
if [ -f $i ]; then
revisions="`git log -n 1 $TARGET | tail -1`..master"
break
fi
done
count=`(cd "$FOREIGN" && git log -p $revisions $SOURCE) | grep '^commit' | wc -l`
# iterate over all commits from oldest to newest
i=1
while [ $i -le $count ]; do
# get complete patch
(cd "$FOREIGN" && git log -p --max-count=1 --skip=`expr $count - $i` $revisions $SOURCE) >$PATCH
# get just the commit message
(cd "$FOREIGN" && git log --max-count=1 --skip=`expr $count - $i` $revisions $SOURCE) >$MSG
# apply patch to file: enter directory and skip pathname from patch
(cd $TARGET_DIR && patch -p`expr $SOURCE_LEVELS + 1` <$PATCH)
# now commit it (can't use commit because we want to preserve date):
# - add to index
for t in $TARGET; do
[ -f $t ] && git add $t
done
# - write index
id=`git write-tree`
# - find information for commit and commit
parent=`git show-ref --hash $TARGET_BRANCH`
origid=`grep ^commit $MSG | sed -e 's/commit //'`
GIT_AUTHOR_NAME="`grep ^Author: $MSG | sed -e 's/Author: \(.*\) <.*/\1/'`"
GIT_AUTHOR_EMAIL="`grep ^Author: $MSG | sed -e 's/Author: [^<]*<\([^>]*\)>/\1/'`"
GIT_AUTHOR_DATE="`grep ^Date: $MSG | sed -e 's/Date: *//'`"
export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE
id=`(grep '^ ' $MSG | sed -e 's/^ *//' && echo && echo "$FOREIGN_NAME commit ID:" && echo $origid) | git commit-tree $id -p $parent`
# - update branch and check it out
git update-ref refs/heads/$TARGET_BRANCH $id
git reset --hard $TARGET_BRANCH
# next patch
i=`expr $i + 1`
done

27
build/import-gdbus.sh Executable file
View File

@ -0,0 +1,27 @@
#! /bin/sh
#
# Run this inside the top level of a clean
# syncevolution git repository. Pass the path
# to a gdbus repository (default: ../libgdbus).
#
# The script switches to the "gdbus" branch
# in the syncevolution repo and then merges all
# patches committed to the "master" branch in the
# gdbus repo, updating the "gdbus" branch
# as it goes along.
#
# The original commit IDs are recorded
# at the end of each commit message.
set -e
set -x
`dirname $0`/import-foreign-git.sh "${1:-../libgdbus}" gdbus src/gdbus 1 \
src/debug.c \
src/debug.h \
src/gdbus.h \
src/mainloop.c \
src/Makefile.am \
src/object.c \
src/watch.c

View File

@ -2,7 +2,7 @@
#
# Run this inside the top level of a clean
# syncevolution git repository. Pass the path
# to a synthesis repository.
# to a synthesis repository (default: ../libsynthesis).
#
# The script switches to the "synthesis" branch
# in the syncevolution repo and then merges all
@ -13,55 +13,8 @@
# The original commit IDs are recorded
# at the end of each commit message.
set -e
set -x
SOURCE=src/sysync_SDK/configs/syncclient_sample_config.xml
SOURCE_LEVELS=4
TARGET=src/syncclient_sample_config.xml
TARGET_DIR=`dirname $TARGET`
SYNTHESIS="${1:-../libsynthesis}"
PATCH=`mktemp`
MSG=`mktemp`
git checkout synthesis
# find lastest imported commit
if [ -f $TARGET ]; then
#
revisions="`git log -n 1 $TARGET | tail -1`..master"
else
# import everything
revisions=master
fi
count=`(cd "$SYNTHESIS" && git log -p $revisions $SOURCE) | grep '^commit' | wc -l`
# iterate over all commits from oldest to newest
i=1
while [ $i -le $count ]; do
# get complete patch
(cd "$SYNTHESIS" && git log -p --max-count=1 --skip=`expr $count - $i` $revisions $SOURCE) >$PATCH
# get just the commit message
(cd "$SYNTHESIS" && git log --max-count=1 --skip=`expr $count - $i` $revisions $SOURCE) >$MSG
# apply patch to file: enter directory and skip pathname from patch
(cd $TARGET_DIR && patch -p$SOURCE_LEVELS <$PATCH)
# now commit it (can't use commit because we want to preserve date):
# - add to index
git add $TARGET
# - write index
id=`git write-tree`
# - find information for commit and commit
parent=`git show-ref --hash synthesis`
origid=`grep ^commit $MSG | sed -e 's/commit //'`
GIT_AUTHOR_NAME="`grep ^Author: $MSG | sed -e 's/Author: \(.*\) <.*/\1/'`"
GIT_AUTHOR_EMAIL="`grep ^Author: $MSG | sed -e 's/Author: [^<]*<\([^>]*\)>/\1/'`"
GIT_AUTHOR_DATE="`grep ^Date: $MSG | sed -e 's/Date: *//'`"
export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE
id=`(grep '^ ' $MSG | sed -e 's/^ *//' && echo && echo "libsynthesis commit ID:" && echo $origid) | git commit-tree $id -p $parent`
# - update branch and check it out
git update-ref refs/heads/synthesis $id
git reset --hard synthesis
# next patch
i=`expr $i + 1`
done
`dirname $0`/import-foreign-git.sh "${1:-../libsynthesis}" synthesis src 3 src/sysync_SDK/configs/syncclient_sample_config.xml

11
src/gdbus/README Normal file
View File

@ -0,0 +1,11 @@
This is a copy of the libgdbus source code:
http://git.kernel.org/?p=bluetooth/libgdbus.git;a=summary
It is licensed under LGPL v2.1, see upstream COPYING.
The source is included here because there is no stable
upstream release. Patches added here need to be submitted
upstream. Likewise, patches applied upstream must be imported.
The build/import-gdbus.sh script automates that process.
See build/import-foreign-git.sh for details.