Monday, December 23, 2013

Checking in the same change on multiple remote branches

We have a situation where we need to commit the same change on multiple remote branches. Of course, the painful way is to create so many clones and then manage them individually in terms of directories.

But with git there is a better way -- managing with remotes. See http://git-scm.com/book/ch2-5.html for an introduction on working with remotes.

To achieve this, setup as many local tracking branches as the number of remote repositories that you want to checkin into:

$ git branch <lb1> <rb1>

Here lb1 and rb1 are local and remote branches. In practice, lb1 can be any name that can be easily memorised and rb1 can be "origin/". Of course origin is a reference depending on the protocol chosen for sharing the remote.

Now, you can just cherry-pick a change from one branch and commit it on a different branch - like so...


$ git branch
$ git checkout lb1 # changes are checked in already on lb1
$ git log --oneline


Now pick up the SHA corresponding to your checkin and continue ...


$ git fetch # just to make sure that you are on HEAD
$ git checkout lb2
$ git cherry-pick --no-commit SHA # SHA is the value copied from lb1


Now check and confirm that all your changes are in order. Finally commit and push ...

$ git commit
$ git push origin HEAD:refs/for/<branch name>


Monday, June 11, 2012

Under House Arrest at Prestige Montecarlo

The residents of Prestige Montecarlo woke up to a reality that I am sure many didn't anticipate - of being under house arrest. The local folks - perhaps being instigated by the local politicians - are agitating and have blocked all entrance and exists from the apartment complex.
All the people, office goers, school goers and even some flight crew are being blocked from going out of the apartment complex and daily lives of all of us is disrupted.
The following is a brief history that culminates to the situation today (Jun 11, 2012) :
  1. Some unidentified people broke down the boundary wall adjoining the ananthapur road - ostensibly for road widening.
  2. The residents went to court to protect the property.
  3. The court has - in the last few days - given an interim order asking the locals to follow the due process of law to acquire land for road widening process.

Hopefully some sense would prevail...



Update (12:30pm): Some sense did prevail. Completely unknown to us, the protesters left the scene together with police (yep! the police was there all along). We don't know what made them leave, and whether they would come back tomorrow morning once again.

Wednesday, November 23, 2011

Writing Hindi for Internet / Emails

Writing in Hindi for internet consumption has been very painful -- so much that Hindi speakers/ writers have been left far behind in adopting internet as a medium of communication.

Most of these writers are comfortable typing with the remington style keyboard. This style of typing was adopted by the Kruti Dev and Devlys fonts. But these fonts are basically modified glyphs - which render properly on printed medium. They provide a key-mapping of hindi glyphs over the english keyboard.


E.g. when you type 'f' on your english keyboard, the matra '' is rendered pictorially, and when you type 'o' the consonant 'व' is rendered pictorially. If both these keys are pressed one after the other - fo - वि gets displayed. But note that this is all pictorial representation. This works because you have the font installed locally. 

However, as many of the hindi typists found out, the problem comes if you want to send the text that you have written using one of these fonts over internet. At that time the messages show the underlying english text and becomes meaningless. I.e. if you wanted to send 'विच्छिन्न' what gets sent is fofPNUu since that's the key-sequence that needs to be typed on an english keyboard using one of those fonts.

The solution to the above problem is to use characters in the unicode range 0x0900-0x097F which are the world-wide standards for displaying hindi characters. 

But just using the corresponding characters does not solve the problem. If we were to do that with 'विच्छिन्न' and just put the corresponding unicode characters in sequence we would get . It turns out that in addition to the character representation in the unicode range, the unicode consortium also prescribed a particular sequence for character composition. I.e. if one wants to get वि, one should type the unicode for व first and then the unicode  for  . This is different from what the typists are used to.

There are other such prescribed sequences - especially dealing with half-consonants. These half-consonants could be typed with a single key-stroke on hindi typewriters so they were atomic. But these are no longer atomic with unicode, instead one needs to compose these half-consonants with two unicode characters - one for the full consonant and a second character for the half-character marker (halant). Composing these half-consonants with is a sure recipe for problems since in such cases the unicode corresponding to must come 'between' the corresponding consonant and the unicode for halant. 

As a result of such mismatches, the hindi typists have had an uphill struggle while trying to communicate on internet. 

Now a bit of history on how the situation has come to this: historically the remington style mechanical typewriters were the first typewriter keyboard layout to become popular at a mass scale. Originally these were created for english with QWERTY as the keyboard layout. The idea behind the keyboard layout was to prevent the mechanical arms from jamming into each other when the typist pressed keys very quickly (and thus typing fast).

With time, the same idea was then adopted for hindi typewriters, resulting in the remington style typewriters.

When adopted to computers the english keyboard maintained its QWERTY layout because it was already in widespread use.

Similarly, when adopting a hindi keyboard layout for use with computers - the Kruti Dev style became very popular. It was already popular with the typewriter user community and it almost provided the same experience when performing offline word-processing tasks on computers.

On the other hand, the unicode committee for hindi provided its own recommendations on how the characters and words should be composed. These recommendations are at wide variance with the way the remington typewriters have been used for composing words in hindi.

To address the differences between the recommended unicode character and word composition methods and the methods used by the remington style typewriters, a few other keyboard layouts have been proposed. Inscript keyboard layout is the most notable of these since this is a *standard* keyboard layout being promoted by a few standards bodies in India.

But the inscript keyboard layout has not seen wide adoption since it alters the habits of the users already comfortable with a keyboard layout. It seems that touch typing is a hard skill to learn and once learnt, it is very hard to change.

Now - knowing that the remington style keyboard is the most popular keyboard layout we tried to solve all the problems associated with character sequence mismatches between the remington style keyboard layout and unicode standard. The tool provided at http://krutidevunicode.com works through all the known composition sequence mismatches between the remington style keyboard sequences and the way unicode standard expects them to be - and provides the users a seamless experience of typing -- as if they were typing on their own comfortable environment. 

Hope this proves to be a small step in helping Hindi become more popular on the internet.

[Note: At some places I have had to use the an images for 'chhoti-e' and incorrectly composed hindi words since the corresponding unicode sequences do not render correctly on the browser]

Sunday, May 16, 2010

Find As You Type in Google Chrome

Do you want Find As You Type feature in Chrome - just following this link and install the extension! Usage:

  • Start writing (or press /) to start text search.
  • Press ' to search only links.
  • Option "direct search state" set the default search policy (links, text or disabled).
  • Use (Shift+)F3 or (Shift+)Control+G or Alt+N/P to switch between matches.
  • Use F4 to toggle matching mode (text/links) once the search has started.
  • Blacklist support for sites that set up their own shortcuts (you can still search with / or ').
  • Search and select options in HTML selects (disabled by default).