The situation in Germany about ownership of stuff you developed in your company or spare time is substantially more nuanced than the GGP post describes. Matters get even more complicated when remote work and trust based working hours (aka: no time tracking) gets in the mix. Add permission to work on OSS in your working hours: Was that code done on company time or not?
There's an entire law about inventions made in your on and off time - the "Gesetz über Arbeitnehmererfindungen". It does cover inventions (patents or similar) that are related to your work, whether done during your work time or outside. (https://www.gesetze-im-internet.de/arbnerfg/__4.html)
The law stipulates compensation and there's a separate set of compensation guidelines that takes into account how related to your work this invention is.
An employer can even claim right of first buy for inventions that are unrelated to the employees work (freie Erfindung), if the employer is active in the area of business that the invention covers (see https://www.gesetze-im-internet.de/arbnerfg/__19.html)
Mind you, this is by law. Many employment contracts will only mention this in passing or not at all.
Now, most contributions to open source will not pass the bar to be an invention in the sense of the law. But if you come up with a novel solution for a hard problem, that might cross the boundaries.