https://github.com/ipfs/go-ipld-git
ipld handlers for git objects
https://github.com/ipfs/go-ipld-git
Last synced: about 1 year ago
JSON representation
ipld handlers for git objects
- Host: GitHub
- URL: https://github.com/ipfs/go-ipld-git
- Owner: ipfs
- License: mit
- Created: 2016-12-13T18:43:45.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-03-29T08:32:13.000Z (about 1 year ago)
- Last Synced: 2025-04-01T05:33:34.726Z (about 1 year ago)
- Language: Go
- Homepage:
- Size: 271 KB
- Stars: 58
- Watchers: 24
- Forks: 19
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Git ipld format
==================
[](http://ipn.io)
[](http://ipfs.io/)
> An IPLD codec for git objects allowing path traversals across the git graph.
## Table of Contents
- [Install](#install)
- [About](#about)
- [Contribute](#contribute)
- [License](#license)
## Install
```sh
go get github.com/ipfs/go-ipld-git
```
## About
This is an IPLD codec which handles git objects. Objects are transformed
into IPLD graph as detailed below. Objects are demonstrated here using both
[IPLD Schemas](https://ipld.io/docs/schemas/) and example JSON forms.
### Commit
```ipldsch
type GpgSig string
type PersonInfo struct {
date String
timezone String
email String
name String
}
type Commit struct {
tree &Tree # see "Tree" section below
parents [&Commit]
message String
author optional PersonInfo
committer optional PersonInfo
encoding optional String
signature optional GpgSig
mergetag [Tag]
other [String]
}
```
As JSON, real data would look something like:
```json
{
"author": {
"date": "1503667703",
"timezone": "+0200",
"email": "author@mail",
"name": "Author Name"
},
"committer": {
"date": "1503667703",
"timezone": "+0200",
"email": "author@mail",
"name": "Author Name"
},
"message": "Commit Message\n",
"parents": [
, , ...
],
"tree":
}
```
### Tag
```ipldsch
type Tag struct {
object &Any
type String
tag String
tagger PersonInfo
message String
}
```
As JSON, real data would look something like:
```json
{
"message": "message\n",
"object": {
"/": "baf4bcfg3mbz3yj3njqyr3ifdaqyfv3prei6h6bq"
},
"tag": "tagname",
"tagger": {
"date": "1503667703 +0200",
"email": "author@mail",
"name": "Author Name"
},
"type": "commit"
}
```
### Tree
```ipldsch
type Tree {String:TreeEntry}
type TreeEntry struct {
mode String
hash &Any
}
```
As JSON, real data would look something like:
```json
{
"file.name": {
"mode": "100664",
"hash":
},
"directoryname": {
"mode": "40000",
"hash":
},
...
}
```
### Blob
```ipldsch
type Blob bytes
```
As JSON, real data would look something like:
```json
"\0'>"
```
## Lead Maintainers
* [Will Scott](https://github.com/willscott)
* [Rod Vagg](https://github.com/rvagg)
## Contribute
PRs are welcome!
Small note: If editing the Readme, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.
## License
MIT © Jeromy Johnson