diff view

Vladimir Prus ghost at cs.msu.su
Fri Dec 7 18:33:13 UTC 2007


David Nolden wrote:

> On Friday 07 December 2007 18:29:30 Vladimir Prus wrote:
>> Hello,
>>
>> I would like to eventually implement a special view for diff files.
>> That is, when a file with extension .diff is opened, I don't want it
>> to be opened with Kate, but rather using a custom code, that will
>> allow, among other things, to apply individual hunks of the diff file.
>> (Whether such custom code will be implementing using Kompare, or really
>> custom code, is not important here).
>>
>> So, how can I make kdevelop, when opening file with specific extension
>> or mime type, to use a designated plugin?
>>
>> - Volodya
> I cannot tell about this one.
> 
> But generally about the diff thing:
> For the teamwork plugin, I have already implemented a mechanism to
> highlight all applied hunks of a diff file in the editor, and to jump
> between the hunks. I think a similarly integrated thing would be perfect
> for selectively applying diff-files, and might be implemented without too
> much work based on the ripped kdiff3 library that's already in teamwork:
> 
> 1. When opening a diff-file, you would need to see some side-panel where
> you see all the hunks.

I'm not sure -- side panel is too narrow for showing hunks effectively.

> 2. When you click a hunk, you would jump to the location of the hunk in
> the source-file, where the according text is highlighted(maybe green for
> applied, blue for not applied, and red for conflict)
> 
> 3. When the cursor is within such a hunk in the source file, you could
> somehow see the alternative text for that hunk, and either apply/unapply
> the hunk.
> 
> For just showing a diff file, a kompare part would be just perfect.

I actually kinda like the Emacs way -- which splits the windows horizontally,
and the patch is on top, while the files being modified are on the bottom.

But there's zillion ways to apply a patch file, and some experimentation
is needed, that's why I'm starting with a technical question of using
non-kate thing to show a particular file.

- Volodya


> 
> greetings, David






More information about the KDevelop-devel mailing list