-
-
Save nghinv/063a30e56f3436f86330d0482a0a86c2 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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