[[Category: Development]]
== Description ==
== Source code ==
=== Collect data ===
Here is the script to produce the data for the graph, called <code>count</code>:
<small><source lang="bash">
#!/bin/sh
latest# Whose patches to count#PAT=$(git tag '@openvz.org|@parallels.com| grep -v -- -rc @sw.ru| tail -n1 @swsoft.com|@sw.com.sg| sed -e kuznet@'s/^#PAT='@openvz.org|@parallels.com|@sw.*\ru|@swsoft.com|@sw.\(com.*\)$/\1/sg|adobriyan@|kuznet@|gorcunov@')((latest++))PAT='@openvz.org|@parallels.com|@sw.ru|@swsoft.com|@sw.com.sg|@virtuozzo.com|kuznet@|gorcunov@'
# Return the date of the given tag, in a format usable by gnuplot
get_tag_date() {
echo $(git show $1 | egrep ^Date: | head -n1) | sed 's/^Date: ... \(.*\) [-+]....$/\1/' | sed 's/ ..:..:..//' | sed 's/ /-/g'} # Count the number of patches whose authors match $PAT,# for the period between two given git tagscount_patches() { git log --pretty=short --no-merges $1..$2 | egrep '^Author: ' | egrep $PAT | wc -l
}
for f in $count_total_patches(seq 13 $latest); do{ v1 git log --pretty=v2short --no-merges $1..6$2 | grep -c '^commit '} # Latest 3.x kernel#latest3=$(git tag | grep -v -- -rc | tail -n1 | sed -e 's/^.*\.\(f-.*\)$/\1)/') d1latest3=$(get_tag_date git tag | grep -v -- -rc | grep -F 'v3.' | \ awk -F . '{print $v12}' | sort -n | tail -n1) # Latest 2.6.x kernellatest26=39 # Find out if [ number of patches for HEAD is much more# than for latest -rc. If yes, use HEAD, otherwise -rc.:last_rc=$f (git describe --abbrev= 0)HEAD=$last_rcif ! test -z "$latest ]last_rc"; then v2 much_more="HEAD "10 else v2 count_head=v2.6$(count_patches v3.$f filatest3 HEAD) d2 count_rc=$(get_tag_date count_patches v3.$latest3 $v2last_rc) echo if test $count_head -n gt $d2 $v2 ((count_rc+much_more)); then HEAD=" HEAD " fifi pv=''for v in $(git log for-each-ref --prettysort=short '*authordate' --no-merges $v1..$v2 | grep format='Author:%(tag)' refs/tags | egrep \ grep -v -E -- '@openvz.org-rc|@parallels.com-tree|@swv2.ru|@swsoft.com|@sw.com6.sg|adobriyan@|kuznet@11' | wc ) HEAD; do if [ -z "$pv" ]; then pv=$v continue fi pd=$(get_tag_date $pv) d=$(get_tag_date $v) count_ours=$(count_patches $pv $v) count_total=$(count_total_patches $pv $v) if test "$count_ours" -lgt 0; then echo $d $v " " $count_ours $count_total fi pv=$v
done | sed 's/ /\t/g'
</source></small>
<small><source lang="bash">
#!/bin/sh
REPO=~/git/linux/.git
COUNT=$(pwd)/count
OUT=$(pwd)/time.dat
export GDFONTPATH=/usr/share/fonts/microsoft
export GIT_DIR=$REPO
if test "$1" != "-f"; then
echo "== Previous (old) stats ==" tail -n 2 $OUT # Update the repo and count new stats (cd $REPO && cd .. && git pull ) && sh count $COUNT > time.dat$OUT echo "== New stats ==" tail -n 2 $OUT
fi
DATE=$(date tail -n 1 $OUT | cut -f 1 | awk -F- '+%d %b %Y{print $2,$1,$3}')MAXY=$(awk 'BEGIN {max=0}; ($3 > max) {max=$3}; END {print max+5080}' < time.dat)# GNU date is powerful!MAXX=$(date +%b-1-%Y --date='+2 months')
export GDFONTPATH=/usr/share/fonts/msttcorefonts/
cat << EOF | gnuplot > plot.png
set terminal png transparent nocrop enhanced font verdanab 8 "verdana,13" size 6001600,4001200
set title "OpenVZ team kernel patches progress as of ${DATE}"
set timefmt "%b-%d-%Y"
set format x "%b\n%Y"
set grid xtics mxtics noytics
set xrange [ : "${MAXX}" ]
set yrange [ 0 : ${MAXY} ]
set ylabel "Number of patches from OpenVZ team,\n per kernel release, accepted into mainstream"
set border 3 # no lines at right and topset xtics nomirror # no tics at topset ytics nomirror # no tics at right
plot 'time.dat${OUT}' using 1:3 with linespoints pt 7 6 ps 1.5 lw 2 lt 2 notitle, \ '' using 1:3:2 with labels left offset 0,1 5.5 rotate notitle, \ '' using 1:3:3 with labels left offset 0.7,0 notitle
EOF
</source></small>