Bug 139233

Summary: kompare does not understand directory structures
Product: [Applications] kompare Reporter: esigra
Component: navigationpartAssignee: Kompare developers <kompare-devel>
Status: RESOLVED FIXED    
Severity: normal CC: bruggie, patrick.allaert
Priority: NOR    
Version: 3.4   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description esigra 2006-12-26 14:12:52 UTC
Version:           3.4 (using KDE KDE 3.5.5)
Installed from:    Gentoo Packages
OS:                Linux

Kompare does not understand directory structures. Reproduce with the following script:
#! /bin/sh
mkdir kompare-directory-bug     && \
cd kompare-directory-bug        && \
mkdir -p tree1/A                && \
mkdir -p tree1/B                && \
mkdir -p tree2/A                && \
mkdir -p tree2/B                && \
echo asdf > tree1/A/file        && \
echo qwer > tree1/B/file        && \
echo asef > tree2/A/file        && \
echo qwdr > tree2/B/file        && \
diff -rU2 tree1 tree2|kompare -
cd ../kompare-directory-bug/..  && \
rm -r kompare-directory-bug


Kompare shows:
Source Folder    Destination Folder
[ ]tree1/A/      [ ]tree2/A/
 └─[ ]tree1/      └─[ ]tree2/
    └─[ ]B/          └─[]B/

Expected:
Source Folder    Destination Folder
[ ]tree1/        [ ]tree2/
 ├─[ ]A/          ├─[ ]A/
 └─[ ]B/          └─[ ]B/
Comment 1 kde 2007-06-16 19:00:32 UTC
I can confirm this on Ubuntu 7.04/Feisty with KDE 3.5.6, Kompare 3.4
Comment 2 kde 2007-06-16 19:01:10 UTC
*** This bug has been confirmed by popular vote. ***
Comment 3 esigra 2008-02-25 15:01:46 UTC
Just a guess; is the bug in kompare.h, constructRelativePath, where the comment says "Find a common root."? At least that comment sounds like it could have something to do with the faulty behaviour.
Comment 4 Kevin Kofler 2008-03-27 09:14:51 UTC
*** Bug 159939 has been marked as a duplicate of this bug. ***
Comment 5 Otto Bruggeman 2009-03-11 22:37:28 UTC
Should be fixed in 4.2.1 and higher.