Change Selection Summary

A common problem faced by programmers is that you may decide that the modifications in your working directory are too complicated to be submitted as a single change, and you want to be able to commit the work piecewise as a series of logically coherent changes.

Qct allows you to select the files that make up each coherent change set, and further allows you to select individual changes within each of those files.

You access this feature via the context menu of modified ('M' state) files. Qct will launch a change selection dialog (above) which presents the diff hunks to the user and asks whether to keep or to shelve each of them in turn. Changes that are kept are left in the working copy of the file. Shelved changes are stored in temporary files and returned to the working copy after a commit or when qct exits.

Prior to Qct-1.4, an external 2-way merge tool was required to perform the change selection. External tools are still supported, but they are no longer used by default.

After you have selected all of the changes that make up one coherent change, entered a log message, and commited your selected changes, Qct will return the remaindered (shelved) changes back into your working directory where the process can be repeated until all of your changes are committed.

Under the hood, these are the steps involved:

In order for this feature to work, your VCS back-end must provide a mechanism for retrieving the unmodified working copy file. If you chose to use an exernal two-way merge tool, it must be able to merge changes from one file into another without modifying the first file (which rules out Meld, as far as I can tell). Most three-way merge tools (kdiff3, gpyfm) can fake a two-way merge, but are clumsy.

Suggested External Two-Way Merge Tools

In Qct-1.4 and later, the built in change selection dialog is suggested. To use the built in dialog you simply leave the two-way tool preference empty.

If you are running on Linux and have KDE installed, I suggest the Kompare diff/merge tool for doing this kind of two-way merge. It seems to have a bug in the file save operation (it will always ask you to save the file even if you already have), but the change selection process is very straight-forward. Kompare is open source, and is part of KDE. Suggested command line: /usr/kde3.5/bin/kompare "%m" "%o"

If you do not have KDE, the next best merge tool I suggest is SourceGear's DiffMerge tool, which is available on Linux, Windows, and MacOSX. It is not open source but it is free on all platforms. Suggested command line: /usr/local/bin/diffmerge -t1=changes "%m" -t2=for-commit "%o"

Gpyfm can be used, albiet a bit clumsily, with this command line: /usr/local/bin/gpyfm "%o" "%o" "%m"

Kdiff3 can be also used, with similar clunkiness, with this command line: /usr/kde3.5/bin/kdiff3 -L1 changes -L2 for-commit "%m" "%o" -o "%o"