Skip to content

Instantly share code, notes, and snippets.

@rhochreiter
Created January 29, 2013 19:22
Show Gist options
  • Save rhochreiter/4666858 to your computer and use it in GitHub Desktop.
Save rhochreiter/4666858 to your computer and use it in GitHub Desktop.
Shell script to emulate the output of "svn log --verbose --xml" for git based on http://stackoverflow.com/questions/11093911/git-log-pretty-with-list-of-files?answertab=active#tab-top
#!/bin/sh
revlist=$(git rev-list HEAD)
(
echo '<?xml version="1.0"?>'
echo '<log>'
for rev in $revlist
do
echo "$(git log -1 --date=iso --pretty=format:"<logentry revision=\"%h\">%n<author>%an</author>%n<date>%ad</date>%n<msg>%s</msg>%n" $rev)"
files=$(git log -1 --pretty="format:" --name-only $rev)
echo '<paths>'
for file in $files
do
echo "<path>$file</path>"
done
echo '</paths>'
echo '</logentry>'
done
echo '</log>'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment