Skip to content

Commit 724b9bd

Browse files
author
amaauricio
committed
first-commit
0 parents  commit 724b9bd

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

git-log.sh

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
##WORK IN PROGRESS
2+
##WORK IN PROGRESS
3+
##WORK IN PROGRESS
4+
##WORK IN PROGRESS
5+
##WORK IN PROGRESS
6+
7+
set -e
8+
9+
echo '<!DOCTYPE html>
10+
<html>
11+
<head>
12+
<meta charset="utf-8">
13+
<title>Git Log HTML</title>
14+
<style>
15+
body { font-family: Courier,monospace; background: #221; color: #FFF; }
16+
ul { list-style: none; }
17+
li { overflow: hidden; padding-bottom: 20px;
18+
margin-bottom: 40px;
19+
border-bottom:1px solid rgba(100,100,100,.3);
20+
}
21+
a { color: #73C7FF; }
22+
.commit{color:cyan}
23+
pre{
24+
font-size: 14px;
25+
color: #6BC9EE;
26+
}
27+
.info{
28+
color:rgba(240, 240, 128, 0.9)
29+
}
30+
.add{
31+
color:green;
32+
}
33+
.remove{
34+
color: red;
35+
}
36+
</style>
37+
</head>
38+
<body>
39+
<ul>' > gitlog.html
40+
echo > changes.log
41+
42+
acum=0
43+
prop=0
44+
45+
git ls-tree -r --name-only HEAD -- web/protected/ | while read filename; do
46+
47+
#define a date limit
48+
git_opts="--since='2017-09-10T22:08:00-07:00' --decorate -- ${filename}"
49+
messages_command="git log -p -1 --pretty=tformat:'' ${git_opts[@]} "
50+
lines_command="git log --pretty=tformat:'<span class=\"commit\">%H </span> - <span class=\"date\">[%cd]</span><pre> __XX123XX__ </pre></li>' ${git_opts[@]}"
51+
52+
messages=$(bash -c "$messages_command")
53+
lines=$(bash -c "$lines_command")
54+
55+
mlen=${#messages[@]}
56+
llen=${#lines[@]}
57+
for (( i=0; i<${mlen}; i++ )); do
58+
message=$(perl -MHTML::Entities -e '$msg=encode_entities($ARGV[1]); $l=$ARGV[0];
59+
$l =~ s/__XX123XX__/$msg/;
60+
$l =~ s/(\+\+\+.+\n)/<span class=\"add\">$1<\/span>/g;
61+
$l =~ s/(\+\t.+\n)/<span class=\"add\">$1<\/span>/g;
62+
$l =~ s/(\-\-\-.+\n)/<span class=\"remove\">$1<\/span>/g;
63+
$l =~ s/(\-\t.+\n)/<span class=\"remove\">$1<\/span>/g;
64+
$l =~ s/(diff.+\n)/<span class=\"info\">$1<\/span>/g;
65+
print $l;' "${lines[$i]}" "${messages[$i]}")
66+
if [[ -z "$message" ]]; then
67+
((acum=acum+1))
68+
else
69+
if [[ "$message" == *"XX123XX"* ]]; then
70+
((prop=prop+1))
71+
else
72+
echo -n "<li>$message" >> gitlog.html
73+
fi
74+
fi
75+
echo -ne "\r${acum} archivos sin cambios y ${prop} commits vacios."
76+
done
77+
done
78+
echo -ne "\n"
79+
echo -n "</ul></body></html>" >> gitlog.html

0 commit comments

Comments
 (0)