ChaniBlog











At Eljakim (my new employer), work repositories are all svn (lowest common denominator), but several of us access them via git-svn. I’ve created a couple of new ones recently, but thanks to timezones, I never get an svn repo until I’ve already done a day’s work (in git). Getting those commits into svn without losing history is a simple thing when you know how – but when I googled, all I saw were strange and crazy hacks involving arcane commands I didn’t understand. So, here’s the easy way:

  • Check out the svn repo
  • git svn clone https://url.to/svn-repo

  • Make a folder for your work (assuming it’s not already there)
  • cd svn-repo
    mkdir chani
    touch chani/temp
    git add chani/temp
    git ci
    git svn dcommit

  • Check out just that folder
  • cd ..
    git svn clone https://url.to/svn-repo/chani merge-repo

  • Connect it to the git repo
  • cd merge-repo
    git remote add mygit /path/to/git-repo
    git fetch mygit
    git checkout -b mymerge mygit/master

  • Rebase your work on top of svn
  • git rebase master
    git checkout master
    git merge --ff-only mymerge

  • Clean up the temp file (is thre a way to just commit an empty dir in git?)
  • git rm temp
    git ci

  • And send it to the server!
  • git svn dcommit

  • Switch back to the primary repo (optional)
  • cd ..
    rm -rf merge-repo
    cd svn-repo
    git svn rebase

Of course, you don’t have to delete the merge repo, you could keep using it as your primary repo – but the way things are set up here I always end up wanting my checkout to be a level above that. :)

Edit: Also, make sure you move or delete the original git repo once the commits are safely in svn. I spent half the day continuing to work in the pure git repo after blogging this… >.< oh well, at least I just had to copy&paste off my blog to fix it. :P



{January 15, 2012}   parallel text – now with audio!

I’m back to language learning again – Dutch now, of course, so that I can understand my co-workers next time I visit. :) This means lots of reading and listening to dutch, not taking boring grammar courses. :) At this stage, I need the english readily available, and the best way to get that is parallel texts (dutch on the left, english on the right, nicely lined up). There aren’t many parallel texts available to buy, and they’re usually sorta boring books, so one of pete’s polyglot friends created a script that will take any two digital books (wherever you happened to get them) and turn them into a big html file, nicely aligned by sentence.

It’s a great tool – however, it’s missing a third aspect: audio. Normally I’d get my listening practice from dubbed tv (I’ve watched all 7 seasons of voyager, and most of DS9, in german) but the dutch don’t care much for dubbing, so it’s hard to get materials. :( What we do have is dutch audiobooks to match some of the parallel texts I’m reading – good quality unabridged audio, too. The problem was, you needed to play the audio in another window, making it a PITA to pause or skip around, or go on to the next file, or find your position again after shutting it all down.

So, I integrated the audio into the parallel text itself. Thanks to the html5 audio tag, I have a little control widget floating at the top of the window; you can scroll the text or pause the audio without moving the mouse anywhere. It’s in the early stages right now, so there’s no synchronization between the text and audio, and it doesn’t remember your position (although session-restore does restore the text position). I have some ideas for that, though.. :) The most annoying issue, really, is that firefox doesn’t support mp3 and half the other browsers don’t support ogg; it seems the only one supporting both is konqueror. So, I’m running it in konq :)

If you’d like to try out the script, it’s fairly simple. I have it hardcoded to expect mp3 files at the moment, but I’ll add an option for that as soon as anyone wants it. All you need is my audio.js file, jquery, and these three lines in your html head:

<script src='jquery.js'></script>
<script src='audio.js'></script>
<script>initAudio("path/to/mp3s/", N);</script>

where files are named 01.mp3, 02.mp3, etc (or 1.mp3, 2.mp3…) and N is the minimum number of digits in a file (yeah, all my files had leading zeros and I didn’t get around to removing them).

Patches and code review are very welcome – this is only the third (or second, depending on how you count) thing I’ve written with jquery. :)



{January 6, 2012}   Weddings and Work

I’m blogging from Utrecht today – for my first week of work. :) So far it’s pretty awesome; I wish I was here for more than just one week. [Edit: in case it’s not clear, I’m going back home at the end of the week, NOT immigrating to the netherlands. ] The guyspeople at the office are great, and I get to work on a cool project: making them an IDE (in qt, of course) for their web framework. :)

In an indirect way, I have KDE to thank for this job, actually. I met my boss at blauzahl and mek’s wedding. :) And the wedding was great, too. Lots of chaos, naturally, but somehow everything fell into place in the end. I still want the recipe for that pumpkin curry. ;) There are photos online, but I’m too lazy to link to them right now.

And now it seems like everyone’s getting married – friends, co-workers, even me. :) I’m engaged to pete now :) :) although we’ve not made any plans yet.

Lots has happened in the last few months. I’ve graduated too, of course. Over christmas I did a bit of work on ContextJournal, too; hopefully I’ll add some timetracking features to it soon (oh look, uncommitted code.. it seems I started already), but at the moment I’ve barely got time for anything but work. :) I have a language-related web project I ought to upload somewhere, too. maybe I’ll blog about that later – but not on planetkde, I suppose. If you want to hear more about what I’m up to, you’ll have to subscribe to my blog separately.



et cetera