From kynnjo at gmail.com  Tue Oct  4 01:24:52 2016
From: kynnjo at gmail.com (Kynn Jones)
Date: Mon, 3 Oct 2016 19:24:52 -0400
Subject: [Rd] On implementing zero-overhead code reuse
In-Reply-To: <789dc6b3-f557-9f5a-d373-09003a699f25@roswellpark.org>
References: <22513.41953.204280.605359@max.nulle.part>
	<CAFvQaj6=UUWafXD5asf-mtho7O1qKs9TLpWmLRdmEhGYh1exVw@mail.gmail.com>
	<CAFvQaj4SLxim=Jqi_yeOrKTRvuhWB7X-C6xXjpCw_pbmfz_=3Q@mail.gmail.com>
	<20161003141859.GV9995@ofb.net>
	<CAC2h7usFJCN1R+Fw_8oaBb37dJdQO5FRLiSgh8tZ_V30nGBmNg@mail.gmail.com>
	<CAFvQaj69J8SuA3uirTa_jpY6JjUZb0DsPiFe5eru=ZbZTS_uLg@mail.gmail.com>
	<789dc6b3-f557-9f5a-d373-09003a699f25@roswellpark.org>
Message-ID: <CAFvQaj6Kr8nbKkt4N+Y3ahiVr2qJEPvQ-XXaBuc-Fqac-uWMiw@mail.gmail.com>

Martin, thanks for that example.  It's definitely eye-opening, and
very good to know.

The installation business, however, is still a killer for me.  Of
course, it's a trivial step in a simple example like the one you
showed.  But consider this scenario:  suppose I perform an analysis
that I may publish in the future, so I commit the project's state at
the time of the analysis, and tag the commit with the KEEPER tag.
Several months later, I want to repeat that exact analysis for some
whatever reason.  If the code for the analysis was in Python (say),
all I need to do is this (at the Unix command line):

    % git checkout KEEPER
    % python src/python/go_to_town.py

...knowing that the `git checkout KEEPER` command, *all by itself*,
has put the working directory in the state I want it to be before I
re-do the analysis.

AFAICT, if the code for the analysis was in R, then `git checkout`, by
itself, would *not* put the working directory in the desired state.  I
still need to re-install all the R libraries in the repo.  And I
better not forget to do this re-installation, otherwise I will end up
running code different from the one I thought I was running.  (I find
this prospect horrifying, for some reason.)

A similar need to re-install stuff would arise whenever I update the repo.

Please correct me if I'm wrong.



[Rd] On implementing zero-overhead code reuse
Kynn Jones