Itcl cget code

I created a patch for Incr Tcl, which allows classes to be extended with cget code. Interresting users will find it in my small Tcl/Tk section, along with a description.
The patch is also officially submitted at the [Incr Tcl] patch management interface.

diff & patch

Application: A program should be enhanced with certain functionality or bugfixes. Changes to the sources should be made persistent and documented (tracing bugs).

  1. make a copy of the original source directory
  2. change the original source directory’s name for convenience, e.g. “name”.orig
  3. change the name of the copied directory as well, e.g. “name”.new
  4. make the changes that are necessary in the “name”.new directory and test them
  5. when ready, create a patch
  6. to have the changes in the original directory, apply the patch there

To create a patch:
diff -ubrN "name".orig "name".new > "name".patch

To apply the patch:
patch -p1 -d "name".orig

So far the core commands and options. diff and patch come with several other helpful options. Especially the --dry-run option to patch should be used, so you can see what would happen if the patch was applied.

These tools are only two of so many, that make lives easy and are often overlooked…