With the help of Johannes I was able to solve the problem with
modifying git commit messages.  Before actually doing it (and
populating the currently empty git repositories on Savannah) I want to
represent the process which I use.

Please comment!  In a few days I'll then actually do the conversion.
Are there any other (scriptable) changes you would like to have
applied to the commit messages?


  1. Get (or synchronize) the CVS repository files:

       cd
       mkdir cvs
       cd cvs
       rsync -avz \
             rsync://cvs.sv.gnu.org/sources/freetype/freetype2/ \
             freetype2

  2. Add an `Authors' file to the `freetype2' directory (attached).

       cd
       cp Authors cvs/freetype2

  3. Call `parsecvs' and compress the git objects:

       cd
       cd cvs/freetype2
       find . -name '*,v' | parsecvs
       git gc

  4. Move the created `.git' directory to a different place and check
     out all files:

       cd
       mkdir git
       cd git
       mkdir freetype2
       mv ../cvs/freetype2/.git freetype2
       cd freetype2
       git checkout HEAD

  5. Generate files which contain empty commit messages, together with
     the affected changes -- this is what I wanted to do from the very
     beginning!

       cd
       cd git
       sh get-empty-logs freetype2

     The `get-empty-logs' script is attached.

  6. Edit the created commit message files.

  7. Apply the modified commit message files to the git repository:

       cd
       cd git
       sh regenerate-git freetype2

     The `regenerate-git' script is attached.


   Werner
antoineL=Antoine Leca <[email protected]>
davidT=David Turner <[email protected]>
erico=Eric Olson <[email protected]>
freetype=David Turner <[email protected]>
gasher=Graham Asher <[email protected]>
jclaudius=Jens Claudius <[email protected]>
jet=Yamato, Masatake (大和正武) <[email protected]>
just=Just van Rossum <[email protected]>
leonardr=Leonard Rosenthol <[email protected]>
mpsuzuki=Suzuki, Toshiya (鈴木俊哉) <[email protected]>
olvaffe=Wu, Chia-I (吳佳一) <[email protected]>
otaylor=Owen Taylor <[email protected]>
Peak=Pavel Kaňkovský <[email protected]>
robert=Robert Wilhelm <[email protected]>
tetisoft=Detlef Würkner <[email protected]>
tomk=Tom Kacvinsky <[email protected]>
werner=Werner Lemberg <[email protected]>
wl=Werner Lemberg <[email protected]>
# get-empty-logs <git repository>
#
# From the given repository, this script exctracts commit messages named
#
#   *** empty message ***
#
# and stores them, together with the corresponding diff, in the current
# directory in files of the form
#
#   <commit date> <commit hash>.txt
#
# The idea is that you modify the messages to something more meaningful.
# Note that everything below (and including) the `snip here' line won't
# be part of the commit message.
#
# After finishing you should call the `regenerate-git' script to apply the
# updated commit messages.

export PATH=/home/wl/git/git.compiled:$PATH
export TRASH_OFF=YES

currdir=`pwd`
cd $1

git log --pretty='format:%ci %H' \
        --grep='\*\*\* empty log message \*\*\*' \
| sed 's/ +0000//' \
| while read filename; do
    git show --pretty=format:'%s%n%n--- snip here ---%n%b' \
        `echo $filename | sed 's/^.* //'` \
    > $currdir/$filename.txt
  done

# eof
# regenerate-git <git repository>
#
# This script applies commit messages in files named
#
#   <commit date> <commit hash>.txt
#
# (as created by the `get-empty-logs' script, for example) to the given git
# repository; the files are expected to be in the current directory.
#
# The idea is that all git objects are checked whether a file name's <commit
# date> and <commit hash> is identical to a git object's commit date and
# commit hash, respectively.  If true, the file's contents down to the `snip
# here' line (which isn't included) is used as a new commit message.

export PATH=/home/wl/git/git.compiled:$PATH
export TRASH_OFF=YES

export currdir=`pwd`
cd $1

git filter-branch \
  --env-filter 'FILENAME=`git show -s --pretty="format:%ci %H" $GIT_COMMIT \
                          | sed "s/ +0000//"`
                export FILENAME' \
  --tag-name-filter cat \
  --msg-filter 'if test -f "$currdir/$FILENAME.txt"; then
                  cat "$currdir/$FILENAME.txt" \
                  | sed "/--- snip here ---/,\$d";
                else
                  cat;
                fi'

# eof
_______________________________________________
Freetype-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/freetype-devel

Reply via email to