git is an object store masquerading as a source code management system (SCM).

git is a simple object store used to store source code trees using a merkle tree.

Git Objects

Git Objects are represented as git object

${type} - Git Object Type as a string

  • blob - any []byte
  • tree - represents a files system tree
  • commit - represents a commit
  • tag - represents a tag

${size} - size in bytes of ${content} represented as a string base 10.

${content} - []byte of the content

Git Blob

A git blob (binary large object) is the type used for file contents in git:

gitblob

  • ${content} - []byte of the file contents
    • Does not include filename or path
    • Does not include mode information
    • Does not include any metadata
    • Just the contents
    • Any file anywhere with the same contents will have the same ‘blob’ object
    • Any file anywhere with the same contents will have the same gitoid

Git Object Id (gitoid)

Git Blobs are identified by the sha1 of the blob object: gitoid

There is some nacent movement in git to SHA-256 for gitoids. As the purpose of GitBOM using gitoids for artifact ids is to match the indexing of the leaf artifacts (aka source files), it is anticipated that GitBOM will follow git’s transition to SHA-256 at the rate it is adopted.