git support: add ChangeLog.txt.

Since git repositories track the whole history of a project,
there's no point in maintaining a change log for them. Sbopkg
expects one nevertheless, since it's historically rsync
oriented.
This patch adds the little code needed to automatically
generate a meaningful ChangeLog.txt from the project history.

Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This commit is contained in:
mauro.giachero 2009-05-21 16:34:21 +00:00
parent 30ad5a995d
commit cf78790cc0

View file

@ -813,6 +813,12 @@ checkout_git_branch() {
# Make sure no changes are staged
git reset HEAD >> $COMMAND_OUTPUT
fi
# Create a changelog
# (it makes no sense to have one tracked in a git repo)
if [[ ! -f ChangeLog.txt ]]; then
git log --pretty=format:"%cd%n%s%n%b" > ChangeLog.txt
fi
}
set_repo_vars() {
@ -1780,6 +1786,11 @@ git_command() {
echo "*/*/*.sbopkg" > .gitignore
git clean -d -f
git reset --hard HEAD
# Create a changelog
# (it makes no sense to have one tracked in a git repo)
if [[ ! -f ChangeLog.txt ]]; then
git log --pretty=format:"%cd%n%s%n%b" > ChangeLog.txt
fi
# All done
rm -f $SBOPKGTMP/sbopkg_sync.lck
echo