Git tip of the day: ‘git reflog’ or How to undo a git rebase?

September 3rd, 2012

Today I messed things up quite a bit in doing an interactive rebase (git rebase -i [COMMIT_ID]). Argh, what to do now after creating all those commits now for the last hours?

The good thing is, nearly always someone else run into this issue already and the search result for ‘git undo rebase’ included as first hit the solution for me.

Use git reflog to find the action before your rebase:

git reflog

Then pick the action you want to go back to and reset to it:

git reset --hard HEAD@{5}

“El pulpo” or “Having some great days at GUADEC 2012 in A Coruña”

August 2nd, 2012

GUADEC 2012 - A Coruña

This years GUADEC took place at A Coruña and besides the usual face to face meetings I took the opportunity to have some deeper discussions in topics I am currently working on. With the GNOME design team and the GTK+ developers we discussed the next steps to improve touch support in GTK+. This all looks really promising.

Martin Pitt did a great job bringing the PyGOBject community together for a Hackfest. I looked at the Gstreamer 1.0 situation and what we need t do to port to it (we have to port to GTK+ 3 and PyGOBject as well at the same time). Most of it is straight forward, but some of the API like TagList is not very pythonic, for example you can not iterate over the taglist. This can be fixed with overrides or by adding API for that purpose, a related discussion happens in this bug.

During the WebKitGTK hackfest I had the opportunity to discuss zoom to content support in WebKitGTK and my request that links that are opened from external applications open in Epiphany in a new tab rather than in a new window. Also it was very interesting to see the recent work that has been gone in the tabless work in Epiphany (aka Web). This is something I envisioned as well for the Sugar Browse activity. Happy to see others working on the same track.

It was a very productive time, happy having seen again known faces and to meet new people. Looking foward to next years GUADEC. Big thanks to all the organizers who made this possible and OLPC for sponsoring my attendance.

“Cargando… Cargando…” or deconnect with an XO and a solar panel

June 7th, 2012

“Cargando”…”Cargando” it says! I wanted this for a long time, now it is real, my XO is charged by solar energy. And as Richard Smith says in the OLPC demo video for the XO being charged by a solar panel: the nice thing is that this is doable with the XO because of the sunlight readable display, you can sit outside and work on the XO and charge at the same time. I am having a 10 Watt solar panel and am using the XO 1.75.

Now I can take part in the switch to use renewable energy sources. I need to find out now how I show up in statistics like the “Solar power generation world record” which was set in Germany a few days ago…

Develop Sugar Activities under Fedora 17

June 5th, 2012

I have been thinking a bit those last days on how to get a good development environemnt for the several tasks around Sugar development (Activity development, Shell/toolkit development), a full list of identified fields is at this post.

I had a quick go at writing up a step-by-step guide for developing an activity under Fedora 17 and hey, I think it has never been that easy. Here are the most basic steps to get you started.

Birthdays – or the OLPC saga is still ongoing

June 1st, 2012

There are many birthdays at the moment. My niece gets 2 today, we are celebrating Fedora 15 end of life those days (yeah it is a bit morbid to celebrate the end of a release but an end means always something new (read here Fedora 17) or something like that), Plan Ceibal has it’s fifth anniversary and this is my first post on the GNOME planet. Yeay! After setting everything up (GNOME membership, hackgotchi…) I am here, feels nice and cozy I see how I will like hanging around with you guys in the future.

About one of those birthdays I want to talk a bit more, Plan Ceibal celebrating there 5th anniversary. Plan Ceibal is an Uruguayan initiative to implement the “1 to 1” model (one laptop per learner) in Uruguay. They use the XO from One Laptop per Child for that. This initiative is about delivering technology but as well as much about education. Deploying those many laptops involves a lot of logistics, from handing out to tracking laptops, collecting broken machines, repairing and giving them back to the learner etc. As well Plan Ceibal is modifying Sugar (the learning platform running on the XO) and adopting to their needs, like adding country specific Activities for example. And then there is the educational part to that project, preparing content, teacher training, preparation of the parents and evaluation of the project itself.

And this initiative is 5 years old now. First laptops handed out in 2007. Amazing. To put some moving pictures to the story you can have a look at the video Plan Ceibal put up.

You my ask now, why does this matter to GNOME? What is the link here? Actually it does mean a lot:

The XO is running Sugar and Sugar is developed on top of the GNOME stack. Basically “Sugar is the GNOME platform + a target audience oriented UI”. When I say here GNOME platform I mean the building blocks, the libraries that are used in the GNOME desktop like GTK+, Metacity or Evince. Sugar does share the platform/application model. But Sugar does not only use the GNOME technologies, it uses as well the knowledge and ecosystem. For example Sugar mimics the GNOME schedule. The freezes, tarball due days, release days we do have as well and we are even in sync which makes sure Sugar is aligned as well with distribution schedules and gives the Sugar developers a chance to work upstream.

And the little green and white laptops do come often as well installed with GNOME as a secondary desktop to have the more advanced applications in the GNOME suite available for the learners as well.

If you look at the numbers today (about 2 million laptops deployed) you can get a feeling how many direct and indirect users GNOME has today that are using the XO. I think this deserves a big sip of your beverage of choice this weekend to celebrate yourself and another sip for Plan Ceibal and all their work and heart that they have put into this. The GNOME community and you are part of this.

GTK+ Hackfest, Brno

February 23rd, 2012

The last days I had the plessure to attend the GTK+ Hackfest in Brno, Czech Republic. The first two days did overlap with the Fedora Developer Conference 2012 where I gave a talk laying out the interaction between the Sugar and the leaning platform (Sugar: using the GNOME platform to build a learning platform). The slides can be found here.

One of the main topics of the hackfest was touch support in GTK+. Which was very exciting to me. Matthias Clasen gave a good summary of the plans and what API we can expect to have in 3.4 in his post. Having scrolling and basic touch events working in 3.4 will be a great basis to start our touch support work in Sugar.

A longtime plan has been made how to integrate Clutter with GTK+ (see Emmanuele Bassi’s post on that). This is all a very exciting domain, another reason why I am excited about the software redering fixup work from Adam Jackson, Fedora 17 Alpha is on it’s way, let’s see what the status of that work is there…

Good news for all the “Sugar-palette-hackers”: there had been fruitful discussions on the future of GTK-Menu: There is the desire to have a menu invoked by a button/widget click, the possibility to put different widgets in the menu, to keep the old feature of keyboard navigation and to fix the grabbing the menu is curently doing. Doesn’t that sound like the same job description as Sugar Palettes have? If we then as well handle the hovering on mouse over and the popdown correctly we are done. For sub menus we should investigate the folded secondary options like the GNOME shell has. This looks like it would solve the “menu-goes-away-while-navigating”-issue, one thing to get right are very long lists of course but this issue is present in any case.

Benjamin Otte has been putting a lot of efforts in validating the theme agains the css spec. For now we have to specify a unit for “border-radius”, “border-width” and “padding” others will follow.

Even though this hackfest has been more about discussions and planning (which is the right thing to do as those activities benefits a lot from being in the same room) I did a bit of hacking as well on custom GTK container support through gobject-introspection with Tomeu. I finalized Tomeu’s/John’s patches for this (663052 and 644926), hopefully we ca land this now soon.

I am really happy about all the progress that has been made during those days. Many thanks to all the organizers and espacially Florian Nadge and Petr Kovar for all their efforts in bringing us to the best food places in town. Thanks to the GNOME Foundation for sponsoring my accommodation, to my employer OLPC for sponsoring my time there and Red Hat for sponsoring the venue and the food.

GNOME foundation


Fedora: unexpected inconsistency, run fsck manually

February 9th, 2012

Yesterday I had a hard shutdown because the battery was running out. I had Firefox running playing a video at that moment. When I restarted the machine after I plugged it in Firefox crahsed. After a while I had as well a kernel crash. After a hard reboot my system would not start enymore and I was left with the message “_Fedora-16-Beta-: unexpected inconsistency, run fsck manually” and dropped to a repair shell. Uff, did I make backups…

Ok, I could run e2fsck now on the partition but I first needed to find out which one was which, the labeling “_Fedora-16-Beta-” didn’t help much here. At least ‘/proc/partitions’ helped me a bit figuring out which one it could be. So yeah I run e2fsck on the partition in question and followed the fixups that were noted. Sure I was doing it manually but to be honest most of the fixup-questions I more or less hoped that ‘yes’ would be the right answer. Luckily, after 2 minutes I had my file system back and could boot my system to type these words…

PS: in the repair shell you feel how the ‘pre-tab-completion’-days must have been, all this typing…

Multitouch: gestures

February 8th, 2012

One other important part of the UI for a touchscreen interface are gestures. For example next/previous movements can be done by a swipe to the right or to the left with your finger on the touchscreen. A good example is an Activity to show your photo album. You could scroll in a fullscreen view of the photos with the swipe.

To make this available in GTK+ the GTK+ developers are designing and implementing this possibility for their toolkit, the gestures API is currently discussed. There is as well a GTK+ branch for multitouch that does implment the current design.

As stated in my previous post I did compile the branch on Fedora rawhide and run it on my Wetab. I did a small python example to see how it feels. Basically you connect to a ‘gesture’ signal and in the callback the gesture_id will tell you which gesture has been done by the user. You define the gestures you are interested in before. You need to make sure that you instruct the widget to listen to touch events: add_events(Gdk.EventMask.TOUCH_MASK).

from gi.repository import Gtk
from gi.repository import Gdk

def __destroy_cb(widget, data=None):

def __gesture_cb(widget, gesture_id, data=None):
    if gesture_id == Gtk.GestureType.SWIPE_RIGHT:
        print 'SWIPE_RIGHT'
    elif gesture_id == Gtk.GestureType.SWIPE_LEFT:
        print 'SWIPE_LEFT'

window = Gtk.Window()
window.set_default_size(450, 450)

window.connect('gesture', __gesture_cb)

window.connect("destroy", __destroy_cb)

Multitouch: press and hold

February 8th, 2012

In the Sugar UI we have currently the following behavior for Palettes: when you left click on a an icon the primary action is executed, if you hover over an icon the Palette with primary and secondary options is displayed (with a small delay to prevent Palettes from popping up undesiredly when moving the mouse over icons fast) and when doing a right click on an icon the Palette with the options is displayed immediately. A good example are the activity icons in the Home View where the above logic applies cleanly.

On touchscreen devices where we only navigate with fingers and where no mouse is provided we do not have the right click option. A lot of the UIs for touchscreen devices do enter this path with a press and hold action. Currently the GTK+ developers are designing and implementing this behavior for GTK+ and the API is discussed. There is as well a GTK+ branch for multitouch that does implment the current design.

I did compile the branch on Fedora rawhide and run it on my Wetab. I did a small python example to see how it feels. Basically you connect to a signal ‘press-and-hold me’ and in the callback you get detailed information about the action. In the callback you can decide whether and how you want to handle the event. An animation is shown while the finger is hold down to emphasize that something is going on.

from gi.repository import Gtk
from gi.repository import Gdk

def __destroy_cb(widget, data=None):

def __press_and_hold(widget, device, action, x, y, data=None):
    if action == Gtk.PressAndHoldAction.QUERY:
        print 'querry'
    elif action == Gtk.PressAndHoldAction.TRIGGER:
        print 'trigger'
    elif action == Gtk.PressAndHoldAction.CANCEL:
        print 'cancel'
    return True

window = Gtk.Window()
window.set_default_size(450, 450)
window.set_title('Press and Hold')
window.connect("destroy", __destroy_cb)

button = Gtk.Button('press-and-hold me')
button.connect('press-and-hold', __press_and_hold)


The animation can be disabled as well, if it is not desired by setting the ‘gtk-enable-animations’ property:

settings = Gtk.Settings.get_default()
settings.set_property('gtk-enable-animations', False)

As well you can theme the animation:

.press-and-hold {
  background-color: alpha (@bg_color, 0.5);
  color: alpha (lighter (@selected_bg_color), 0.8);
  border-width: 40;

All in all I like the proposed API and it feels straight forward. As well I think that having the animation will help the user experience. Looking forward that this great work will get merged!

Fedora: the case for the /usr merge

February 7th, 2012

There is a Feature targeted at Fedora 17 that is “getting rid of the separation of /bin and /usr/bin, as well as /sbin and /usr/sbin, /lib and /usr/lib, and /lib64 and /usr/lib64. All files from the directories in / will be merged into their respective counterparts in /usr, and symlinks for the old directories will be created instead”. More info about the reasoning for that change is available at the systemd page.

I hapened to have an f16-to-rawhide-updated system here. Yesterday I wanted to install gcc to build a GTK3 example which failed because of the filesystem package doing a runtime check, from the spec:

# RPM runtime check in the buildroot; this ensures we can not install
# the incompatible filesystem.rpm on unconverted systems                                                                                                                                   
Requires: rpmlib(X-CheckUnifiedSystemdir)

Peter pointed me kindly to the instructions for resolving that dead end, which worked great for me.