exporting of local changes in gdbus

Importing was already possible, improved README about that.
Exporting is added in this commit.
This commit is contained in:
Patrick Ohly 2009-12-09 11:53:02 +01:00
parent bb8f1ddde4
commit 3fc19c58d1
3 changed files with 95 additions and 2 deletions

46
build/export-foreign-git.sh Executable file
View File

@ -0,0 +1,46 @@
#! /bin/sh
#
# Exports changes made to files so that the upstream
# maintainers can import the changes into their own
# git repo. All changes which are not marked as
# being from the remote git repo with a "commit ID"
# comment are exported.
#
# Result are numbered .patch files, as with "git format-patch".
#
# Run this inside the top level of a clean
# syncevolution git repository with the following
# parameters:
# - file system path for foreign git repository
# - a remote directory into which the source file(s) are to be placed,
# preserving all remaining directories after stripping
# - common local directory to be stripped from source file(s)
# - one or more source file names, with paths relative to the
# local repository
set -e
set -x
FOREIGN="$1"
shift
TARGET_DIR="$1"
shift
SOURCE_DIR="$1"
shift
SOURCE="$@"
FOREIGN_NAME=`basename $FOREIGN`
# iterate over commits involving the relevant files,
# starting with oldest one
counter=1
for commit in `(git log --format=format:%H $SOURCE; echo) | perl -e 'print reverse(<>)'`; do
if git log -n 1 $commit | grep -q "$FOREIGN_NAME commit ID"; then
# nothing to do, is in original git repo
true
else
file=`printf %03d $counter`-`git log -n 1 --format=format:%f $commit`.patch
counter=`expr $counter + 1`
git log -n 1 -p --stat --format=email $commit $SOURCE | perl -p -e "s;$SOURCE_DIR;$TARGET_DIR;g;" -e "s/^index [0-9a-f]*\.\.[0-9a-f]* [0-9]*\n$//;" >$file
fi
done

26
build/export-gdbus.sh Executable file
View File

@ -0,0 +1,26 @@
#! /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`/export-foreign-git.sh "${1:-../libgdbus}" src src/gdbus \
src/gdbus/debug.c \
src/gdbus/debug.h \
src/gdbus/gdbus.h \
src/gdbus/mainloop.c \
src/gdbus/object.c \
src/gdbus/watch.c

View File

@ -6,6 +6,27 @@ 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 and build/export-gdbus.sh scripts
automate that process.
The build/import-gdbus.sh script automates that process.
See build/import-foreign-git.sh for details.
To import fixes from upstream:
- checkout out libgdbus and syncevolution
- enter syncevolution directory
- if not done before, create local "gdbus" branch:
git branch gdbus origin/gdbus
- run build/import-gdbus.sh
- "gdbus" branch is now checked out and updated
- verify changes, merge into master, etc.
- push into remote syncevolution repo
To export fixes to upstream:
- check out relevant branch in syncevolution
which has our local changes (typically "master")
- run build/export-gdbus.sh
- send 0*.patch files to upstream
Caveats:
- only files explicitly mentioned in the two scripts
are imported/exports
- Makefile changes are only imported, but not exported
(local changes not relevant upstream)