📜 ⬆️ ⬇️

Visual representation of SVN commit activity in the terminal

In small personal projects I use SVN and the bug tracker in such cases is an A4 sheet. svn log has never been easy to read for me, so I wrote a bash script that allows you to visually see development activity lately or a list of commits of a given date:

image


')
 #!/bin/bash usage='usage: ./svn_log <days> OR ./svn_log <date> examples: ./svn_log 10 OR ./svn_log 2013-08-02' # 1.    -   ($days)     YYYY-MM-DD ($date) param=$1 if [ -n "$param" ]; then if [[ "$param" =~ ^[0-9]+$ ]] ; then days="$param" elif [[ "$param" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]; then date="$param" else echo "$usage" exit 1 fi else days=7 #         fi # 2.        -     if [ -n "$days" ]; then # svn log       start=`date +"%Y-%m-%d" --date "$end -$days day"` svn_log=`svn log -r {$start}:HEAD` for (( i=0; i<$days; i++ )) do #       YYYY-MM-DD day=`date +"%Y-%m-%d" --date "$end -$i day"` #       svn log num_commits=$(echo "$svn_log" | grep "$day" | wc -l) #   echo -ne "$day " for (( c=0; c<$num_commits; c++ )); do echo -ne '#' done echo '' done fi # 3.     -      if [ -n "$date" ]; then svn_log=`svn log -r {$date}:HEAD` echo "$svn_log" | grep -A 2 -B 1 "$date" | awk "NR%4==0" fi 


Download script: pastebin.com

I would be glad if this tool is useful to anyone else.

Source: https://habr.com/ru/post/188872/


All Articles