Incremental changes and rollback

  • Ben Kirkpatrick

    Ben Kirkpatrick - 2010-07-25

       I do lots of little changes, roughing out a program very slowly.  I may compile and test a program 50+ times before it's exactly the way I want it.  (A lot of this is learning curve; I only get 20 minute increments to play with).  I made a little change to COMPILE.BAT which records the changes made each time I compile.

    Add these lines just before the call to GCBASIC:

    echo "=====================" >> %1.log
       date /T >> %1.log
       time /T >> %1.log
       echo "=====================" >> %1.log
       c:\cygwin\bin\diff %1.bak %1 >> %1.log
       copy %1 %1.bak

    You will need to do a minimal install of a program called CYGWIN in order to get the utility called "diff".  This is the thing that compares two versions of a file and prints the difference.  Available at , this add many unix tools to windows.

    If you get this setup correctly, after the first run or two, you'll see files called *.log which match the name of source files you compiled.  If you break something or make a bad decision, go to this file to remind you what was changed recently.  It's sequential, so you may need to go to the end of the file to see the last change.


  • Ben Kirkpatrick

    Ben Kirkpatrick - 2010-07-25

    So for example, here's what it would log if I went in to change a temperature conversion:

    C:\PROGRA~1\GCBASIC>more SingleTC.txt.log

    Sat 07/24/2010
    07:00 PM
    < TempW = TempW / 9
    < TempW = TempW * 5
    < TempW = TempW - 32
    > TempW = TempW * 9
    > TempW = TempW / 5
    > TempW = TempW + 32

    C:\PROGRA~1\GCBASIC>more SingleTC.txt.log


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks