Sat Nov 2 03:45:32 CET 2013

Kdevelop Review Area

In the Review Area of kdevelop it sais: "On the Review area you will be able to find the tools you need to review changes in your projects, either the ones you made or some external patch." That sounds very promising, but I was never able to make it work with git. Also there is hardly any documentation about this feature. Recently I made some progress understanding how to use this feature.

The easiest mode of operation is the scenario that you have local changes in your working directory. In that case, just right-click your project and choose Git -> Show differences.... You will be automatically transfered to the review area, presented with an overview of all changes and the possibility to choose individual files. If you do, the file will open with the modified lines annotated on the side. You can also view the changes in a side-by-side viewer by choosing Export Diff... -> Side view (kompare), although I have to click Unapply All for each file in kompare to actually see the changes (who knows why...).

But what if you have just fetched in some new branch "new_feature" into your git repository and want to see what has changed? In that case go to Review, select Custom Patch and your project directory as Base. Go to the tab From command and write the command that will generate the diff:

git diff --no-prefix new_feature

Note the --no_prefix option, without that it will not work. Probably you will also have to check Already applied. Again, as before, you can choose to export the diff to kompare for a side-by-side view. For some reason this does not work on remote branches, you have to create a local branch from the remote.

This review function is quite handy in many situations. But if things get really dirty I prefer a three-way diff to compare branches. For this you can use

$ git merge-base master new_feature

to get a common ancestor of the two branches. Clone your repository to /tmp/base and /tmp/other, checkout the ancestor commit in /tmp/base and new_feature in /tmp/other, and finally call

$ kdiff3 /tmp/base your_project_dir /tmp/other

Posted by Raimar | Permanent link | File under: gnu_linux
Diese Seiten werden auf einem Server der Universitaet Innsbruck gehostet und unterstehen diesen Richtlinien.