[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ft-devel] git problem solved
From: |
Werner LEMBERG |
Subject: |
[ft-devel] git problem solved |
Date: |
Sun, 08 Mar 2009 10:30:24 +0100 (CET) |
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 <address@hidden>
davidT=David Turner <address@hidden>
erico=Eric Olson <address@hidden>
freetype=David Turner <address@hidden>
gasher=Graham Asher <address@hidden>
jclaudius=Jens Claudius <address@hidden>
jet=Yamato, Masatake (大和正武) <address@hidden>
just=Just van Rossum <address@hidden>
leonardr=Leonard Rosenthol <address@hidden>
mpsuzuki=Suzuki, Toshiya (鈴木俊哉) <address@hidden>
olvaffe=Wu, Chia-I (吳佳一) <address@hidden>
otaylor=Owen Taylor <address@hidden>
Peak=Pavel Kaňkovský <address@hidden>
robert=Robert Wilhelm <address@hidden>
tetisoft=Detlef Würkner <address@hidden>
tomk=Tom Kacvinsky <address@hidden>
werner=Werner Lemberg <address@hidden>
wl=Werner Lemberg <address@hidden>
# 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
- [ft-devel] git problem solved,
Werner LEMBERG <=