source/build separation

David Brown haskell3 at
Tue Nov 15 18:11:10 CET 2011

On Tue, Nov 15, 2011 at 04:47:18PM +0000, Simon Marlow wrote:

>You could do all this with git clones, but it would mean extra 
>shuffling of patches around.  If you're happy with that, then that's 
>fine - use whatever scheme you're more comfortable with.

There's a script in git's contrib directory called 'git-new-workdir'.
You can use it to have multiple working directories that share the
same git back end.  I'll typically do something like:

   git clone ... mainsrc
   git new-workdir mainsrc worksrc
   cd worksrc
   git checkout -b work
     .. hack ..
   git add; git commit
   cd ../mainsrc
   git merge work  # or cherry-pick or whatever
   test away

I find it helps when making multiple patches to be able to test that
the intermediate versions work, without having to mess up my main
working tree.

To install the script, just copy it somewhere into your path, and make
it executable.  Or make an executable script in your path like this:

   exec sh /usr/share/doc/git/contrib/workdir/git-new-workdir "$@"


More information about the Glasgow-haskell-users mailing list