Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
3d738e1c
"web/app/api/vscode:/vscode.git/clone" did not exist on "172274b8091e8925fc53d19bd8a58171dfec00be"
Commit
3d738e1c
authored
Jun 06, 2020
by
Davis King
Browse files
sanitize git logs for export to html
parent
88310147
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
docs/bash_helper_functions
docs/bash_helper_functions
+4
-1
No files found.
docs/bash_helper_functions
View file @
3d738e1c
...
...
@@ -32,7 +32,10 @@ git_logs_as_xml()
# What paths to include in the logs
local paths="../dlib ../examples ../tools ../python_examples"
(echo "<log>"; git log --stat=80 --date=iso-strict --pretty=format:"</files_changed></logentry>%n<logentry revision=\"%H\">%n<author email=\"%ae\">%an</author>%n<date>%ad</date>%n<msg>%s</msg>%n<files_changed>%n" $logrange $paths | tail -n+2 ; echo; echo '</files_changed></logentry>' ; echo "</log>" ) > $outfile
(echo "<log>"; git log --stat=80 --date=iso-strict --pretty=format:"</files_changed></logentry>%n<logentry revision=\"%H\">%n<author email=\"%ae\">%an</author>%n<date>%ad</date>%nGIT_COMMIT_MESSAGE_BEGIN%sGIT_COMMIT_MESSAGE_END%n<files_changed>%n" $logrange $paths | tail -n+2 ; echo; echo '</files_changed></logentry>' ; echo "</log>" ) > $outfile
# sanitize git commit messages
sed -e '/GIT_COMMIT_MESSAGE_BEGIN.*GIT_COMMIT_MESSAGE_END/ { s/</\</g; s/>/\>/g; s/GIT_COMMIT_MESSAGE_BEGIN/<msg>/g; s/GIT_COMMIT_MESSAGE_END/<\/msg>/g; }' -i $outfile
# trim whitespace at start and end of <files_changed> tags.
sed -e ':a' -e 'N' -e '$!ba' -e "s/<files_changed>[ \n]*/<files_changed> /g" -e "s/[ \n]*<\/files_changed>/<\/files_changed>/g" -i $outfile
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment