28 October 2012

How to use git as client with subversion or perforce repositories


As a super git fan, I wish every repository in the world be a git repository. However, we are not in an ideal world, and from time to time we run into other types of SCMs, and we have no choice but to use them. I guess the chances of encountering subversion and perforce repositories is pretty high, because they are popular as a free tool and a commercial tool respectively.

Now, being a heavy user of subversion before I "svn switch" to git, I have not problem dealing with subversion repositories when I have to, but that doesn't mean I don't miss git when I'm doing so. Fortunately, git  comes with a built-in tool, git-svn, that allow us to use git as a svn client. Here is a very brief introduction to git-svn. 

# like svn checkout, but it creates a local git working folder
git svn clone //trunk

# normal git commit as we do with git repositories
git commit -a -m "first commit"
git commit -a -m "second commit"

# this command submits the new git commits to svn repository
git svn dcommit

# like svn update
git svn fetch

For more information on git-svn (e.g. branching and merging), go to http://www.kernel.org/pub/software/scm/git/docs/git-svn.html.

Some big organizations didn't mind paying for a commercial SCM tool, and here we are stuck with perforce. But again, we are fortunate because git has recently added support for git-p4 too. Note that this feature has only been included to the git tool recently, so we need to make sure we are having the latest version. Here's the version I'm using.

git --version
git version 1.7.12.3

Here's how you use git-p4. Note that git-p4 doesn't help us setup the p4 config files, we still have to do it ourselves. 

# suppose we have our p4 config file setup properly.
$ p4 login

# to clone, but it creates a local git working folder
git p4 clone //depot/main

# normal git commit as we do with git repositories
git commit -a -m "first commit"
git commit -a -m "second commit"

# to push change to p4 server
git p4 rebase
git p4 submit

# to fetch changes from p4 server
git p4 sync

For more information on git-p4 (e.g. branching and merging), go to http://kb.perforce.com/article/1417/git-p4.

25 August 2010

iPhone Developers, Turn That File Vault OFF!!!

I started using a new iMac at work a few months back. Since it's a new start, I liked to give the File Vault feature a try. And that was a curse that I did not become aware of until recently.


As an iPhone developer, Xcode and iPhone Simulator are the two most frequently used pieces of software of all. When they don't work as expected, I feel really frustrated. And frustrated it is when I found that iPhone application (running on iOS 4.0) doesn't quit automatically when I try to deploy and run an updated version of app from Xcode (Build & Run by hitting Command+R). But the existing running instance enters background instead of terminating as it should. As a result, the application is update on the simulator, but the running instance is out of date. That issue made developing and debugging very difficult.

It's only yesterday that I found out File Vault was the immediate cause of this. My solution was creating an new account and start over.

13 May 2010

Notes on iPhone Application Localization

To localize an iPhone application, it's not sufficient just to localize strings in code and string in xib files.

For app itself
  • Localizable.strings for strings in code (NSLocalizedString)
  • Nib files (every *.xib file)
  • InfoPlist.strings for Info.plist
  • Strings in Settings.bundle, if there is a Settings.bundle
  • Any other app specific resources that contains text visible to users (e.g. level definition file in a game, external help file etc.)
For app store
  • App descriptions
  • "What's new in this version"
  • Keywords
The above is an incomplete list because I'm afraid there are something else to be localized that I'm not aware of. However, it is a good list to start with.

Google Native Client SDK for Chromium

With Google Native Client SDK, games on the web are so possible now!!
Chrome OS is going to survive with this.

However, security is a big concern. I'm wondering whether Google will take Apple's approach on iPhone with this, making it as close as possible to keep everything trusted.

If Google just go with the ActiveX Control approach (basically no control at all), this native API is going be a time bomb.


11 April 2010

Section 3.3.1 of iPhone OS Developer Agreement

We've been there before, and intermediate layers between the platform and the developer ultimately produces [sic] sub-standard apps and hinders the progress of the platform.
- Steve Jobs on section 3.3.1 of iPhone OS Developer Agreement

The statement is sadly very true, for most time. As a developer using Objective-C ans Xcode, section 3.3.1 doesn't really change anything for me, and probably even a good news. That made the platform more homogeneous and well-staged.

However, I do feel bad for those developers that are betting their chips on Flash, MonoTouch, Unity etc. Their chance of coming to the iPhone are practically ruined. The only chance for them is to give up their platform/language and jump into the bitten apple circle.

14 January 2010

How to compile 64bit version of boost and Qt for windows

I recently start building 64bit version of an application I've been working on for windows 7 64bit.
The first stone I hit was that all the third-party librares the application references need to be recompiled under 64bit mode. It took me some time to figure that out, and I wish sharing this info may save some troubled minds.

boost
> cd boost_1_41_0
> bootstrap
> bjam toolset=msvc-9.0 variant=debug,release architecture=x86 address-model=64

Qt
> C:\Programe Files\Microsoft Visual Studio 9.0\VC\vcvars32all.bat amd64
> cd \Qt\4.6.0_amd64
> configure
> nmake

Still working on the compilation of 64 bit ffmpeg, mingw is really giving me headache.

19 January 2009

Google Shutting Down Notebook Development

The news of google shutting down the development of google notebook saddened me, like it did to millions to other people. Although they say shutting down development is not the same as shutting down the service, I say it is a hint to move on and forget about it.

Bearing its humble and limited in features, I never gave up using google notebook for its ubiquitousness, hoping google would make it a even greater product some day. Now that the hope is gone, I have no choice but to look for alternatives.

There are two possible choices right now, zoho notebook and evernote. After analyzing pros and cons, I decided to switch to evernote, which provides desktop clients as well as a web interfaces. It turned out that they've built an iPhone client.

After half a day's work, all notes have been transferred to evernote. Moving on, and never look back.