Monday, April 22, 2013

Perforce and cygwin

Are you a command-line freak ? Do you want your automated shell scripts to run on Windows ? Do you wish to work with Perforce commands on Cygwin?

You would have experienced the difficulty of running perforce commands on cygwin. The problems which occur due to cygwin's inability to convert Windows paths to it's own /cygdrive/c equivalent.
Example:
  $ p4 have pom.xml
       Path '/cygdrive/c/p4_workspaces/guruss1_p4server2_workspace/depot/On-Prem/AA/7.5.0.0/application/adaptive-authentication\pom.xml' is not under client's root 'C:\p4_workspaces\guruss1_p4server2_workspace'.

Solutions:
1) Use perforce cygwin client: 
    Perforce provide special 'p4.exe' which resolves all these issue. We just need to download it and make it available from default path.
    Where to download ?
       The available latest version which I found is     http://filehost.perforce.com/perforce/r12.1/bin.cygwinx86/ 

   The last release is made on May/2012 and hence it got the support for perforce's latest features like Streams, SSL , etc.
   But perforce announced the discontinuity of support for Cygwin p4 client from May/2013 

2) Add below function to your cygwin's ~/.bashrc
    function p4() {
        export PWD=`cygpath -wa .`
        /cygdrive/c/Program\ Files/Perforce/p4.exe $@
    }

    This will take care of all path related issues and we can use the same perforce client delivered along with P4V.

3) Add AltRoots: field to your workspace ( or client) spec
     Example:
       AltRoots: 
        /cygdrive/c/p4_workspaces/guruss1_p4server2_workspace   

    This doesn't solve all the problems as I have observed. It works for 'p4 sync', but it didn't for 'p4 have'

Tuesday, April 9, 2013

FeatureBranch v/s FeatureToggle v/s BranchByAbstraction patterns

This blog is excerpts from Martin Fowler blog and Continuous Delivery book (Jez Humble, David Farley). It explains about the concepts of
1) Feature Branch
    http://martinfowler.com/bliki/FeatureBranch.html
2) Feature Toggle
    http://martinfowler.com/bliki/FeatureToggle.html
3) Branch By Abstraction
    http://continuousdelivery.com/2011/05/make-large-scale-changes-incrementally-with-branch-by-abstraction/

    This post explains how to avoid branching in Source control.