Short cheatsheet how to update patches to newer milestone using git
===================================================================

+ [some stuff writen off the top of my head, please ping me (Kendy) if it does
  not work for you]

+ create a list of patches to update somehow
  + eg. ls build/dev300-mOLD/applied_patches | sed 's/^....-//' > patches-list.txt

+ create an empty git tree containing the old milestone
  + using eg. make unpack
  + cd build/dev300-mOLD
  + ../../bin/create-gitignores.sh
  + git add .
  + git commit -am "initial - dev300-mOLD"

+ commit the patches to git
  + to a separate branch
    + git checkout -b patches_branch
  + from the list we have created above

    C=1 ; cat ../../patches-list.txt | while read P
    do
        F=`ls ../../patches/*/$P | grep -v 'patches/test'`
        if [ -f "$F" ] ; then
            echo "===== $P ($C) ====="
            C=$(($C+1))
            grep -v '^diff --git' "$F" | git apply -p0 --index --ignore-whitespace --unidiff-zero
            git commit -m "$P"
       else
            echo "missing $F"
       fi
    done > .log 2>&1

+ commit the new milestone to master
  + switch back to master
    + git checkout master
  + remove everything in build/dev300-mOLD
    + rm -r *
  + cd ../..
  + configure --with-tag=dev300-mNEW
  + make unpack
  + cd build/dev300-mOLD
  + mv ../dev300-mNEW/* .
  + git add .
  + git commit -am "New milestone mNEW"

+ rebase to the new milestone
  + git checkout patches_branch
  + git rebase -i master
    + remove the patches that you already know that have been upstreamed
      + query for multiple bugs, ehm issues, in IZ
        + http://www.openoffice.org/issues/buglist.cgi?issue_id=<no.>,<no.>,<...>
    + tweak whatever else you think you might need to tweak
    + exit the editor, and with each problem that appears
      + fix the stuff
      + git add fixed.cxx files.cxx
      + git rebase --continue
        + to commit what needs to be committed & continue, or
      + git rebase --skip
        + to skip that patch

+ copy back
  + when you are done
  + git format-patch --no-prefix master
  + and

    for I in *.patch
    do
        P=`grep '^Subject:' $I | sed 's/^.*\] //'`
        F=`ls ../../patches/*/$P | grep -v 'patches/test'`
        echo "$I -> $F"
        tail -n +6 $I > $F
    done
