#!/bin/sh
#
# CODE_CHANGE_REPORT.sh
#
# count the number of lines changed in a file
# $1..$n are the names of files and directories to count
# Directories are recursed into. Modified from origional
# PureAtria version to account for printing of empty files and
# allow for filtering of source file types.  The report
# prints lines of code changed for each file within the
# past week, month, quarter, half-year and year.
#
# NOTE: This works for ClearCase version 2.x or better.
#
# Author: Charles W. Clarke III (ABS)
# email:  charles@abs-consulting.com
# URL:    http://www.abs-consulting.com
# Date:   Aug. 16, 1996
############################################################
# History: 08/16/96 : Created for A Better Solution, Inc.
############################################################

USAGE:
CODE_CHANGE_REPORT.sh Path_1 [ Path_2 .. Path_N ]

An example of output is below:

              Lines changed in the past period (cummulative):

 Total
 Lines    Week  Week%   Month Month%  Quartr Quart%  HalfYr HlfYr%    Year  Year%  File
------  ------ ------  ------ ------  ------ ------  ------ ------  ------ ------  ------------
   451       0   (0%)       0   (0%)       0   (0%)       9   (1%)       9   (1%)  ./afpread.c
    25       0   (0%)       0   (0%)       0   (0%)       4  (16%)       4  (16%)  ./afpread.h
   782       0   (0%)       0   (0%)       0   (0%)      10   (1%)      10   (1%)  ./cfd2vip.c
    79       0   (0%)       0   (0%)       0   (0%)      10  (12%)      10  (12%)  ./document.c
   223       0   (0%)       0   (0%)       4   (1%)      12   (5%)      17   (7%)  ./draw.c
    17       0   (0%)       0   (0%)       0   (0%)       4  (23%)       4  (23%)  ./error.c
   283       0   (0%)       0   (0%)       4   (1%)       7   (2%)       7   (2%)  ./field.c
   800       0   (0%)       0   (0%)       4   (0%)      70   (8%)      70   (8%)  ./font.c
    25       0   (0%)       0   (0%)       0   (0%)       4  (16%)       4  (16%)  ./font.h
    39       0   (0%)       0   (0%)       0   (0%)       4  (10%)       4  (10%)  ./line.c
    75       0   (0%)       0   (0%)       0   (0%)      11  (14%)      11  (14%)  ./map.c
   882       0   (0%)       0   (0%)       0   (0%)      10   (1%)      10   (1%)  ./mockup.c
   829       0   (0%)       0   (0%)      65   (7%)     602  (72%)     602  (72%)  ./nop.c
   367       0   (0%)       0   (0%)       0   (0%)      10   (2%)      10   (2%)  ./output.c
    29       0   (0%)       0   (0%)       0   (0%)       9  (31%)       9  (31%)  ./output.h
   302       0   (0%)       0   (0%)       4   (1%)       7   (2%)       7   (2%)  ./page.c
    77       0   (0%)       0   (0%)       0   (0%)      15  (19%)      15  (19%)  ./pageseg.c
   503       0   (0%)       0   (0%)       0   (0%)      10   (1%)      10   (1%)  ./ptx.c
    50       0   (0%)       0   (0%)       0   (0%)       4   (8%)       4   (8%)  ./ptx.h
    90       0   (0%)       0   (0%)       0   (0%)      11  (12%)      11  (12%)  ./sfid.c
   253       0   (0%)       0   (0%)       0   (0%)      12   (4%)      12   (4%)  ./testaddr.c
    62       0   (0%)       0   (0%)       0   (0%)       4   (6%)       4   (6%)  ./testafp.c
   342       0   (0%)       0   (0%)       0   (0%)      11   (3%)      11   (3%)  ./testdata.c
    75       0   (0%)       0   (0%)       0   (0%)       4   (5%)       4   (5%)  ./testfont.c
  1170       0   (0%)       0   (0%)       4   (0%)      12   (1%)     395  (33%)  ./text.c
    54       0   (0%)       0   (0%)       0   (0%)       2   (3%)       2   (3%)  ./textwidth.c
   139       0   (0%)       0   (0%)       0   (0%)       0   (0%)       0   (0%)  ./usw.c
======  ====== ======  ====== ======  ====== ======  ====== ======  ====== ======  ==========
  8023       0   (0%)       0   (0%)      85   (1%)     868  (10%)    1256  (15%)   27 files



View Tool Code.