forked from Wavyzz/dolibarr
Fix git tools
This commit is contained in:
@@ -117,7 +117,7 @@ exec($commandcheck, $output_arrtd, $resexectd);
|
||||
|
||||
|
||||
// Count lines of code of dependencies
|
||||
$commandcheck = 'dev/tools/github_authors_and_commits_bydate.sh byday';
|
||||
$commandcheck = "git log --shortstat --use-mailmap --pretty='format:%cI;%H;%aN;%ae;%ce'"; // --since= --until=...
|
||||
print 'Execute github_authors_and_commits_bydate to count number of commits by day: '.$commandcheck."\n";
|
||||
$output_arrglpu = array();
|
||||
$resexecglpu = 0;
|
||||
|
||||
@@ -30,10 +30,10 @@ if [ "x$3" != "x" ]; then
|
||||
fi
|
||||
|
||||
echo "--- Number of different contributors for the year"
|
||||
echo "git log --since $FROM --before $TO | iconv -f UTF-8 -t ASCII//TRANSLIT | grep ^Author | awk -F'<' '{ print $1 }' | sort -u -f -i -b | wc -l"
|
||||
echo "git log --use-mailmap --since $FROM --before $TO | iconv -f UTF-8 -t ASCII//TRANSLIT | grep ^Author | awk -F'<' '{ print $1 }' | sort -u -f -i -b | wc -l"
|
||||
git log --since $FROM --before $TO | iconv -f UTF-8 -t ASCII//TRANSLIT | grep '^Author' | awk -F"<" '{ print $1 }' | sort -u -f -i -b | wc -l
|
||||
|
||||
|
||||
echo "--- Number of commit $1"
|
||||
echo "git log --pretty='format:%cd' --date=format:'$DATEFORMAT' | iconv -f UTF-8 -t ASCII//TRANSLIT | sort | uniq -c | awk '{ if (\$2 >= '"$1"') { print \"Year: \"\$2\", commits: \"\$1 } }'"
|
||||
echo "git log --use-mailmap --pretty='format:%cd' --date=format:'$DATEFORMAT' | iconv -f UTF-8 -t ASCII//TRANSLIT | sort | uniq -c | awk '{ if (\$2 >= '"$1"') { print \"Year: \"\$2\", commits: \"\$1 } }'"
|
||||
git log --pretty='format:%cd' --date=format:"$DATEFORMAT" | iconv -f UTF-8 -t ASCII//TRANSLIT | sort | uniq -c | awk '{ if ($2 >= '$1') { print "Year: "$2", commits: "$1 } }'
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
Releases=("3.9" "4.0" "5.0" "6.0" "7.0" "8.0" "9.0" "10.0" "11.0" "12.0" "13.0" "14.0" "15.0" "16.0" "17.0" "18.0" "develop")
|
||||
let "counter = 0"
|
||||
|
||||
echo "Copy script into /tmp/github_commits_perversion.sh"
|
||||
echo "Copy script into /tmp/github_commits_byversion.sh"
|
||||
cp $0 /tmp/github_commits_perversion.sh
|
||||
|
||||
echo "Delete /tmp/git"
|
||||
|
||||
@@ -20,7 +20,7 @@ if [ "x$START" = "xSTART.." ]; then
|
||||
fi
|
||||
|
||||
echo "git log $START$2 --shortstat | grep ... | perl ... > /tmp/github_lines_perusers.tmp"
|
||||
git log $START$2 --shortstat | iconv -f UTF-8 -t ASCII//TRANSLIT | grep -e 'Author:' -e 'Date:' -e ' changed' -e ' insertion' -e ' deletion' | perl -n -e '/^(.*)$/; $line = $1; if ($line =~ /(changed|insertion|deletion)/) { $line =~ s/[^0-9\s]//g; my @arr=split /\s+/, $line; $tot=0; for (1..@arr) { $tot += $arr[$_]; }; print $tot."\n"; } else { print $line."\n"; };' > /tmp/github_lines_perusers.tmp
|
||||
git log $START$2 --shortstat --use-mailmap | iconv -f UTF-8 -t ASCII//TRANSLIT | grep -e 'Author:' -e 'Date:' -e ' changed' -e ' insertion' -e ' deletion' | perl -n -e '/^(.*)$/; $line = $1; if ($line =~ /(changed|insertion|deletion)/) { $line =~ s/[^0-9\s]//g; my @arr=split /\s+/, $line; $tot=0; for (1..@arr) { $tot += $arr[$_]; }; print $tot."\n"; } else { print $line."\n"; };' > /tmp/github_lines_perusers.tmp
|
||||
|
||||
echo "Users and nb of lines";
|
||||
cat /tmp/github_lines_perusers.tmp | awk 'BEGIN { FS="\n"; lastuser=""; } { if ($1 ~ /^Author:/) { sub(/<.*/, ""); lastuser=tolower($1) }; if ($1 ~ /^[0-9]+$/) { aaa[lastuser]+=$1; } } END { for (var in aaa) print var," ",aaa[var]; } ' | sort
|
||||
|
||||
Reference in New Issue
Block a user