Log Message:
-----------
* utils/cherry-pick-all: back-porting helper script.
Tags:
----
LKML-branch
Modified Files:
--------------
unionfs:
ChangeLog (r1.699.2.41 -> r1.699.2.42)
Added Files:
-----------
unionfs/utils:
cherry-pick-all (r1.1.2.1)
Revision Data
-------------
Index: ChangeLog
===================================================================
RCS file: /home/cvs/unionfs/unionfs/ChangeLog,v
retrieving revision 1.699.2.41
retrieving revision 1.699.2.42
diff -L ChangeLog -L ChangeLog -u -d -b -B -p -r1.699.2.41 -r1.699.2.42
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,7 @@
+2007-07-03 Erez Zadok <[EMAIL PROTECTED]>
+
+ * utils/cherry-pick-all: back-porting helper script.
+
2007-03-03 Erez Zadok <[EMAIL PROTECTED]>
* run-regression-per-mount-dev.sh: remove obsolete script.
--- /dev/null
+++ utils/cherry-pick-all
@@ -0,0 +1,85 @@
+#!/bin/sh
+# cherry pick *all* unionfs patches from one release to another
+# useful to back-port Unionfs from one release to another.
+
+# (c) 2007 Erez Zadok, Stony Brook University
+
+# usage:
+# 1. first get-fetch the repository where you're going to cherry-pick from
+# 2. Then run this script as follows
+# $ unionfs-cherry-pick.sh HASH
+#
+# where <HASH> is the first unionfs patch that in FETCH_HEAD that you want
+# applied. This script will cherry-pick that patch and all patches that
+# came after it to the current cloned git repository. The patches are
+# applied in *reverse* order, from oldest to newest.
+#
+# Before applying the patch, the script touches the file named DONE/<HASH>
+# to mark that it had attempted to apply the <HASH> patch. If the cherry
+# picking was successful, the script goes on to the next patch until done or
+# an error occurred. If an error occurred, you must fix it: usually it's a
+# git/cvs merge conflict. After fixing, you can rerun this script, which
+# would skip over all patches marked as DONE in DONE/<HASH>.
+
+# check if we're in the right dir
+if [ ! -d .git ] ; then
+ echo "you must be in the top level of a checked out GIT repository"
+ exit 1
+fi
+if test -z "$1" ; then
+ echo "Usage: $0 HASH"
+ exit 1
+fi
+
+mkdir -p DONE
+
+# prepare list of patches to use
+if [ ! -f DONE/patches ] ; then
+ echo "PREPARING PATCH LIST"
+ git log FETCH_HEAD | egrep "^commit" | cut -d' ' -f2 > DONE/patches
+ if test $? != 0 ; then
+ echo "preparing list of patches failed"
+ fi
+ # check if my start patch exists
+ if egrep -q $1 DONE/patches ; then
+ :
+ else
+ echo "cannot find hash $1 in FETCH_HEAD"
+ exit 1
+ fi
+ # truncate list of patches
+ rm -f DONE/tmp
+ while read i ; do
+ echo $i >> DONE/tmp
+ if test "$i" = "$1" ; then
+ break
+ fi
+ done < DONE/patches
+ # reverse list
+ reverse-lines.pl DONE/tmp > DONE/patches
+ rm -f DONE/tmp
+fi
+
+# now apply patches one by one
+count=`wc -l DONE/patches | cut -d' ' -f1`
+total=$count
+while read i ; do
+ let count=count-1
+ # skip patches already done
+ if test -f DONE/$i ; then
+ echo "SKIP ($count/$total): $i"
+ continue
+ fi
+ # mark that we're "working" on a patch
+ touch DONE/$i || exit $?
+ echo
'----------------------------------------------------------------------'
+ echo "CHERRY-PICKING PATCH ($count/$total) $i ..."
+ git cherry-pick $i
+ if test $? != 0 ; then
+ echo "PATCH $i failed. Please fix problem and rerun this script."
+ exit $?
+ fi
+done < DONE/patches
+
+echo "ALL DONE"
+exit 0
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs