Bug 387266 - Keyboard shortcut to show VCS (git) Annotations require file to belong to project but when invoked from GIT plugin it works
Summary: Keyboard shortcut to show VCS (git) Annotations require file to belong to pro...
Status: CONFIRMED
Alias: None
Product: kdevelop
Classification: Applications
Component: UI: general (show other bugs)
Version: 5.1.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-24 15:47 UTC by Juraj
Modified: 2017-11-24 16:00 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Juraj 2017-11-24 15:47:47 UTC
Keyboard shortcut to show VCS (git) Annotations require file to belong to project but when invoked from GIT plugin it works perfectly.

How to reproduce:
1. Open file which does not belong to project but belong to GIT repository
2. Use keyboard shortcut to show Annotations...
3. See error message "Could not annotate the document because it is not part of a version-controlled project."

Workaround:
1. From toolview "FileSystem" or "Documents" invoke context menu for file
2. Select {Git > Annotations...}
3. See nice annotations (aka git blame)

Expected behaviour:
Keyboard shortcut to show annotations should check if file belongs to VCS instead of version-controlled project.
Comment 1 Friedrich W. H. Kossebau 2017-11-24 16:00:37 UTC
Still valid for 5.2+

Some brain dump from developer for the one working on this:
shortcut support is coming from DocumentController (which creates the global action with the shortcut). Its handler DocumentController::vcsAnnotateCurrentDocument() does some checks about the file belonging to a project for picking the project's vcsplugin to invoke stuff with.

The context menu though is filled by the git plugin without the check, thus also providing its actions for project-external files.

Should be turned into consistent behaviour IMHO.