On Mon, Oct 09, 2017 at 08:07:56PM +0100, Thomas Adam wrote:
> So we could go down this route---indeed, I see nothing wrong with the analysis
> at any rate.

So back of the envelope calculation, just limited to $git_repo/fvwm/*, I
calculate the following:

 $ for i in *; do; c="$(git --no-pager blame "$i" | grep -c '^\^')"; \
   [ $c -gt 0 ] && echo "$i:$c"; done | sort -t':' -k2 -nr > ./sorted

This scans all the files in the specified directory, and uses git-blame to
determine how many lines in each file are unchanged since Jason commited the
original revision.  These are totted up and dumped to a file.

I get the following:

  icons.c:127
  fvwm.c:107
  builtins.c:104
  decorations.c:63
  virtual.c:55
  screen.h:55
  colormaps.c:54
  module_interface.c:50
  events.c:47
  menus.c:36
  misc.c:31
  placement.c:24
  read.c:22
  functions.c:20
  focus.c:13
  fvwm.h:12
  borders.c:12
  bindings.c:10
  style.c:9
  add_window.c:9
  menus.h:5
  misc.h:2

Adding up all those numbers (which indicates those lines not changed since the
original commit), that comes to:

  876

So -- that's 876 lines of cose *untouched* since the original import of FVWM
into CVS.  But, now we need to work out what that is as a percentage.

* Total lines of all files identified in the files above:

  $ while read n; do f=$(cut -d: -f1 <<< "$n"); \
    echo $(wc -l $f); done < ./sorted > ./file_count

  Then:

  $ awk -F' ' '{t += $1}; END {print t};' ./file_coun

This gives:

  50507

Hence, a quick check says that:

  (50507 - 876) = 49640 = (49640 / 50507) * 100 = ~98%

Or:

Only ~2% of Jason's initial commit remains untouched to date.   From a quick
glance, a lot of that seems to be comments, but there's a few code changes
there.

Just in terms of the main fvwm src directory, we've rewritten pretty much all
of it, and could easily finish off the remaining 2%.

I haven't done any analysis of other areas of the repo though.

-- Thomas Adam

Reply via email to