This make Commit a typed struct with a Set(Commit).
This also fixes a case where the recursive detection for determining
if a Def can be created was not working.
The initial, naive generated code that adds type info to Noms structs
built a new Package object every time a new struct instance was
created. They always had the same ref, so the result was correct, but
there was a lot of work for nothing. This patch caches Package objects
so that we only build them once.
We want to explore encoding type information about Noms data in
the Noms database. So, we need some way to describe types. This
takes the shortest path to making a Noms type called "TypeRef" that
is a peer of Set, Map et al and can describe all the types we currently
use.
When computing if a Map/Set key contains another Map/Set/List we need
to ensure that we are not hitting a recursive type or we hit an i-loop.
Partial fix for #320
Due to limitations in Go we cannot create a Def for a Map or Set that
has a key that is a Map, Set or a List. This is because the key if a Go
map needs to be a comparable and maps and slices are not comparable.
The codegen.go command line utility now detects the package name from
the file that it was invoked from if `--package` was not provided.
It also processes all `.noms` files in the current directory in case
the `--in` flag was not provided.