It is perfectly fine to put Haskell for Mac repositories under Git revision control. However, we suggest to not run git init
inside a Haskell for Mac project directory. Instead, create a new directory for the Git repository, and then, place the Haskell for Mac project into that repository directory. (This is essentially the same set up that you use with Xcode projects.)
Background explanation
Haskell for Mac saves projects atomically. That means that it always makes sure to save a consistent state for all files in a project, even in the case of a power failure or similar interruption during the saving process. Atomic saves are important to avoid data loss in the face of an interrupt of the saving process. However, they confuse standard shells, which you probably use to operate the Git command line interface.
Technical details for those interested
Haskell for Mac uses Cocoa's document management functionality to save projects into a new directory and then renames that directory to the project name after all files have been written. This works fine with other Cocoa apps, which are aware of these directory updates. However, standard shells get confused as the Unix inode of the project changes — although its file path is still the same.
0 Comments