2010-08-30

fixups on an existing commit using tig and the new autosquash option on rebase



This shows how to use tig and the new option in rebase to do fixups very quickly.

What you need first is this line in your ~/.gitconfig:


# fixup, from http://permalink.gmane.org/gmane.comp.version-control.git/154460
fixup = "!f() { git commit -m\"fixup! $(git log -1 --pretty=%s $1)\"; }; f"

and these lines in your ~/.tigrc:

bind main = !git fixup %(commit)
bind main R !git rebase --autosquash -i %(commit)
bind generic s view-status

We need to make a quick change in conf/example.gitolite.rc. We first make the
change, then start tig

type 's' for status view, then cursor down to the file that you just changed

type 'u' to stage that file

type 'q' to quit status view and go back to main view; cursor down to the
commit you want to "fixup"

hit enter to make sure it is the right one; it is... the filelist confirms it

hit 'q' to get rid of the commit details, then '=' to invoke the "git fixup"


Notice the commit message?

hit enter to get past that commit confirmation message, then arrow down 1 line

hit "R" to rebase with respect to the selected commit

save and exit the editor

hit enter to see the new commits

2010-08-10

long time Mandriva user tries Fedora

I have switched my laptop over to Fedora 13 LXDE to check things out properly in normal use; here are my findings so far.  (Remember I have > 10 years of history as a Mandriva user!)

Plus points

  • recognises the Tata Photon+ CDMA data stick out of the box.  The GUI is identical, except for color, to the one in Linux Mint; now why can't Mandriva also use that same software, whatever it is?  In Mandriva, you have to use wvdial (which means you have to install it first!).  The normal drakconf-spawned config screen asks you for a "PIN number" (huh?) and regardless of what you type or not, it responds saying "have you inserted your SIM card" or some such message I can't recall.
  • the ability to create a custom live CD with everything I want on it.  Thanks to my friend Raj, I now have a nice live CD (actually USB stick) that contains more than 200 packages of my choice.  This means I truly don't have to take my laptop around to many places, while still getting a LOT of work done.
  • having a sane set of package repos automatically configured even if you live in India!  Mandriva would always select some mirror in China that, consistently across the last 2-3 releases of Mandriva, has been dead or unresponsive or overloaded any time I try it.  I'd gotten to the point that I'd pretend to be in some US time zone, then change it to India after the install is all done.  Or go to easyurpmi.zarb.org and do a manual mirror selection.
Minus points
  • missing or outdated packages.  (For example, "recoll" -- if I ever have to switch my work desktop this would be a show stopper!  And "atop" is unmaintained.  And unison is apparently deprecated... in favour of what, I wonder?)

    However, the saving grace is that the Fedora ecosystem is just too big for anyone to ignore, so either the upstream themselves will have an RPM available (as in the case of recoll and atop), or someone else (like Dag) might, or -- worst case -- my PFE (personal Fedora expert/evangelist, a person who shall remain nameless in his own interest, lest he be swamped by others' requests for help!) will find me a link from somewhere!
  • keychain doesn't work.  I had to add these 3 magic lines into my own .bash_profile because the one in /etc/profile.d didn't seem to work.  I should probably dig deeper and report it if needed
        keychain ~/.ssh/id_rsa
        . ~/.keychain/$HOSTNAME-sh
        . ~/.keychain/$HOSTNAME-sh-gpg

  • There is no way to have the screen lock before suspend/hibernate.  This is not secure.  I finally had to put "xscreensaver-command -lock; sleep 2" somewhere inside a file called "pm-action".  There is just no other way as far as I know.  From a non-techie user perspective this is horrible, horrible, horrible.  (I realise this may be only the LXDE spin and perhaps the KDE or GNOME versions do it ok).
  • The touchpad doesn't let you click.  You have to run gnome-mouse-properties and change the settings, which would be fine, but they don't persist across a logout/login.  Each time you login you have to run that command again.  (Weirdly enough, you don't have to touch the settings; they're all there.  But the GUI has to come up once...)
Still, all in all it was a pleasant experience, especially because my friend Raj showed me how to make my own live image with whatever packages I want in it.  In the end that might be a bigger point than all the rest :-)

2010-08-05

making a multi-boot USB (and mandriva troubles)

So today my young colleague Vignesh and I spent some time figuring out how to put more than one live CD onto a USB stick. Without using any external tools (except "unetbootin").

In brief:

  • make ext2/3 partitions for each live CD you want to install; make sure you add about 10-20% extra space (moving from iso9660 to ext2 seems to do that!)
  • run unetbootin for each live CD in turn, to its respective partition
  • on the first partition, edit extlinux.conf to remove any cruft, and then tack on to the end of it just the one or two relevant paragraphs from the same file of the other partitions (i.e., the other live CDs that you unetbootin-ed). Make the identifiers sequential (not sure it works if they repeat; by default they all start with 0)
  • make sure all the vmlinuz files and initrd files mentioned in these extract are all copied to the first partition. Watch for name duplication, extra components in the pathnames in the conf file paras that you didn't create (you just dumped 'em all into the first partition's top level directory!) etc., and change the conf lines to fit the filenames
  • make one final "extlinux -i /dev/first-partition"
  • make sure this is the one marked "bootable" in fdisk

and you're done.

----

Unless one of the live CDs you want is Mandriva :-(

God what a pain. First of all, without initrd tweaking it cannot be "unetbootin"-ed. This is because the extlinux.conf entries don't come with UUID= options, so unless it's the first partition it won't get past that. Worse, the "linuxrc" file inside the initrd.gz hardcodes"-t iso9660". Come on.... why? The mount command should be able to figure out the partition type dammit!

What Vignesh finally did to make it work was

  • add a root=UUID= parameter to the "kernel" lines in the config (2 of them; one for live, one for install)
  • patch linuxrc to comment out all the stuff to do with labels and add this line in their place:
    sh -c 'root=`grep -o "UUID=[a-zA-Z0-9\-]*" /proc/cmdline`; mount -o ro $root /live/media'

And that seemed to work for me too.

Once.

After that it never worked again (back to sqshfs errors). And after a couple more attempts I just gave up... Mandriva is not really worth it as a quick-check-your-email-on-a-borrowed-laptop live CD anyway so there's no point:

  • it's too slow (an *installed* Mandriva boots slower than mint or F13 running off a USB stick)
  • it doesn't support my Tata Photon+ USB thingie (what do they use, WiMax? not sure) out of the box -- you have to install wvdial, which it doesn't come with!
  • and most important, it's the only one that needs 5 clicks before it gets to the desktop. It's like they didn't intend to make it a real "live CD", but only as an installer

----

Looks like my MDV days may be numbered, and not just because I promised a friend of mine (who favours Fedora) that I'd switch to Fedora if they start using gitolite either. Sad... The future looks Fedora-ish blue for my machines and minty-green for the ones I manage for my non-tech f&f.