Bug 369346 - Annotation Show Diff... shows incorrect in-line diff for old commits
Summary: Annotation Show Diff... shows incorrect in-line diff for old commits
Status: REPORTED
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: patchreview (other bugs)
Version First Reported In: git master
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-25 17:56 UTC by Igor Kushnir
Modified: 2022-10-24 06:10 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Kushnir 2016-09-25 17:56:37 UTC
There are Show Diff... and Show Diff (all files)... actions in the KDevelop's Annotation Bar context menu.
In case when a file was modified after the interesting commit, the line numbers in the current version of the file are different.
After clicking Show Diff... KDevelop loads the current version of the file alongside the (correct) Overview tab and tries to show an old diff in this file.
The diff is usually incorrect  since the patch no longer applies to the new version of the file.

I can think of two ways to deal with this issue:
1. Display the older version of the file in Patch Review mode - from the interesting commit.
2. Show only one tab - Overview - in this case.

Reproducible: Always

Steps to Reproduce:
1. Load a project with git VCS into KDevelop.
2. Open a file that has been changed several times.
3. Right click in the document area -> Git -> Annotation...
4. Pick an older commit in the middle of the document, right click on it in the Annotation Bar -> Show Diff...

Actual Results:  
The (correct) diff in the Overview tab differs from the diff displayed in the next (file) tab.

Expected Results:  
Diff is correct in all tabs.
Comment 1 Justin Zobel 2022-10-24 00:46:53 UTC
Thank you for reporting this bug in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 2 Igor Kushnir 2022-10-24 06:10:15 UTC
The bug is still present in current KDevelop master - version 5.10.221170 (22.11.70)