However, when I had tried to merge your lazy script into my build script I got the following error:
error: pathspec 'linaro-10.1' did not match any file(s) known to git.
Am I doing something wrong?
repo start <name you want to give to the branch> <project path>
repo start Linaro-cm10.1 CyanogenMod/android_bionic
Just looked at that script; to avoid the problem of having to git pull for every single repo after a repo sync you can create branches using repo start.
In this way you create a branch that gets updated every time you repo sync and it will stay in that branch; no need to checkout back to your branch after a repo sync. Basically, the commits you added will get reapplied on top of the new changes pulled from CyanogenMod's repo.