do you know this: You work on something locally in git, ensure everything compiles and the tests pass, then commit and hit
git push.What could possibly go wrong at that point, eh? Well, far too often I forgot to
git add some new source file. Best-case I’ll notice this directly, worst-case I’ll see my CI complaining. But, like yesterday in
kdev-clang, I might be afk at that point and someone else will have to revert my change and I’ll have to fix it up the day after, polluting the git history while at it…
Thanks to some simple shell scripting and the powerful
git hook architecture, it is pretty simple to protect oneself against such issues:
# A hook script to verify that a push is not done with untracked source file
# To use it, either symlink this script to $your-git-clone/.git/hooks/pre-push
# or include it in your existing pre-push script.
# Perl-style regular expression which limits the files we interpret as source files.
# The default pattern here excludes CMakeLists.txt files and any .h/.cpp/.cmake files.
# Extend/adapt this to your needs. Alternatively, set the pattern in your repo via:
# git config hooks.prepush.sourcepattern "$your-pattern"
pattern=$(git config --get hooks.prepush.sourcepattern)
if [ -z "$pattern" ]; then
files=$(git status -u --porcelain --no-column | sed "s/^?? //" | grep -P "$pattern")
if [ -z "$files" ]; then
echo "ERROR: Preventing push with untracked source files:"
echo "$files" | sed "s/^/ /"
echo "Either include these files in your commits, add them to .gitignore"
echo "or stash them with git stash -u."
just a quick announcement: KDevelop 4.7.0 Beta 1 was released! Head over to the announcement on the KDevelop website to read more:
Cheers, see you soon with a KDevelop 4.7.0 stable release :)
I’m happy to announce the availability of two new betas: Massif-Visualizer 0.4 Beta 1 and KGraphViewer 2.2 Beta 1!
If you want to test this release, you can download the tarballs from the KDE mirrors:
Download Massif-Visualizer 0.4 Beta 1
md5 sum: 2953089078bd2170ad9d2d583c7c8b95 massif-visualizer-0.3.90.tar.xz
sha1 sum: 6d76134b1b41b887ba595a0585f941d22e066b76 massif-visualizer-0.3.90.tar.xz
sha256 sum: 9940fa90137ca5eef08b9ec220825fadbf03db423a670a2c7fe3edab271d9922 massif-visualizer-0.3.90.tar.xz
Download KGraphViewer 2.2 Beta 1
md5 sum: b3a18cbaf661d1cf186b3a3674c31186 kgraphviewer-2.1.90.tar.xz
sha1 sum: 4f0cb86f01eb9725191a79291cbd75061682ca69 kgraphviewer-2.1.90.tar.xz
sha256 sum: 1ae74c1a51e252e88afb7a3d7864fc1bc6326c191ad36c89cc7fab7e8a96f08f kgraphviewer-2.1.90.tar.xz
Time flies… The extremely productive hack sprint at the friendly Blue Systems office in Barcelona is over for more than a week. I haven’t had time to blog about the last days yet which I hereby make good for!
I spent a lot of time at the sprint polishing the KDevelop Clang plugin. A up-to-now semi-secretly developed language plugin based on clang which will replace our current C++ language support in KDevelop in the long-run.
Code completion of
std::string in a
Showing a clang-generated warning inside the editor.
Nested clang diagnostics with browsing support.
KDevelop’s current C++ plugin
But a bit of history first: KDevelop’s current C++ language plugin can pull off what it does by essentially implementing (parts of) the C++ standard. We have our own C++ parser, we have our own implementation of the C++ template mechanism, we have our own share of “compiler bugs”, …. It should not surprise anyone that this is a maintenance nightmare. And indeed, with C++11 and the wealth of changes it came with our language simply fails in many areas. The current codebase is big (~55k sloc) and adding support for complicated features such as variadic templates or constexpr is extremely hard and fragile. So instead of doing that, my colleague Olivier JG started looking into using clang of LLVM fame instead. It promises an API for third-party tools to steer a C/C++/Objective-C compiler to their needs. Its the magic bullet which we waited for, and which did not exist back when KDevelop 4.0 was started initially.
Hey all! Greetings from the joint Kate/KDevelop sprint at the Blue Systems office in Barcelona!
I only arrived yesterday but already I have great news for you: After months of work I finally merged the
sharedurls branches into master for KDevelop/KDevplatform etc. pp. There I worked on a optimization in our handling of file paths.
The status quo up until know was the following: When importing a folder as a project in KDevelop, we filled a model with every file and folder in the project (recursively). For every item we also stored its path as a
KUrl to the potentially remote location.
QUrl are awesome when you have to work with paths and urls, but as soon as you store potentially thousands of them at the same time it becomes quite inefficient. Assume e.g. you open
/foo/bar/blub/ which contains
/foo/bar/blub/bla.h. When you use
QUrl to store these paths, you cannot share any memory between the two, as internally basically a
QString is used. Thus, when you import deep folder trees or folders with many files, you’ll waste a lot of memory for common sub-paths. Furthermore, due to the amount of allocations required, reading the tree is pretty slow.
Holy moly yet another KDevelop release - but this time a big one! Go and get 4.6.0 while it’s fresh and read the full announcement on the KDevelop website:
since some people asked me: The slides to my extended Apps on Speed talk from this year’s Qt DevDays Berlin are available for download. If you are interested, get them here: http://devdays.kdab.com/wp-content/uploads/2013/11/qt-dd-2013-apps-on-sp…
I hope you liked that talk. I certainly had fun presenting it and discussing the contents with various attendees later on. I have now quite some ideas on how to extend the talk even further.
The slides of the other presentations are also available. Stay tuned for the video recordings of DevDays Berlin, I’m sure they will be accessible soonish :)
Edit: The video is now available! Enjoy http://www.youtube.com/watch?v=C5EPt50Kgmc
I just announced KDevelop 4.6 Beta 1 on the KDevelop website. Go read the announcement and test the hell out of this release :) I’m pretty confident that its already a very solid release though!
Cheers, happy hacking!
KDevelop 4.5.2 is finally released! Go see the announcement on our website for more info: http://kdevelop.org/45/kdevelop-452-available
Note that this release contains some serious crash fixes, so update asap, i.e. as soon as your packagers get to it :)
Enjoy and thanks to all contributors! Looking forward to KDevelop 4.6 already!
Today, after a bit more than a month since I started working on it, I merged the
projectfilter branches into KDevplatform/KDevelop. This is a generic configuration interface and library which allows users to customize which folders/files KDevelop includes in a project.
How to use it
The simplest way to use the new code to exclude items from a project, is to use the context menu. Simply right click on any folder/file (not the project root, or anything target related) and choose the “exclude item from project” action. This will then add a filter for the selected item(s). If you want to undo this, go to the project configuration (see below) and remove the filter.
For more advanced management of project filters, or to remove filters and/or adapt the default filters, you need to go to the project configuration and select the new “Project Filter” config page. This allows you to add new filters, remove existing ones or edit them, including reordering them.