Monorepo for Tangled

lexicons: add lastCommit to sh.tangled.repo.tree

quite easily calculated as the most recently modified file in the
present tree.

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li 54b89d3f 27a3e035

verified
+67 -13
-2
api/tangled/repoblob.go
··· 21 Hash string `json:"hash" cborgen:"hash"` 22 // message: Commit message 23 Message string `json:"message" cborgen:"message"` 24 - // shortHash: Short commit hash 25 - ShortHash *string `json:"shortHash,omitempty" cborgen:"shortHash,omitempty"` 26 // when: Commit timestamp 27 When string `json:"when" cborgen:"when"` 28 }
··· 21 Hash string `json:"hash" cborgen:"hash"` 22 // message: Commit message 23 Message string `json:"message" cborgen:"message"` 24 // when: Commit timestamp 25 When string `json:"when" cborgen:"when"` 26 }
+14 -2
api/tangled/repotree.go
··· 16 17 // RepoTree_LastCommit is a "lastCommit" in the sh.tangled.repo.tree schema. 18 type RepoTree_LastCommit struct { 19 // hash: Commit hash 20 Hash string `json:"hash" cborgen:"hash"` 21 // message: Commit message ··· 27 // RepoTree_Output is the output of a sh.tangled.repo.tree call. 28 type RepoTree_Output struct { 29 // dotdot: Parent directory path 30 - Dotdot *string `json:"dotdot,omitempty" cborgen:"dotdot,omitempty"` 31 - Files []*RepoTree_TreeEntry `json:"files" cborgen:"files"` 32 // parent: The parent path in the tree 33 Parent *string `json:"parent,omitempty" cborgen:"parent,omitempty"` 34 // readme: Readme for this file tree ··· 43 Contents string `json:"contents" cborgen:"contents"` 44 // filename: Name of the readme file 45 Filename string `json:"filename" cborgen:"filename"` 46 } 47 48 // RepoTree_TreeEntry is a "treeEntry" in the sh.tangled.repo.tree schema.
··· 16 17 // RepoTree_LastCommit is a "lastCommit" in the sh.tangled.repo.tree schema. 18 type RepoTree_LastCommit struct { 19 + Author *RepoTree_Signature `json:"author,omitempty" cborgen:"author,omitempty"` 20 // hash: Commit hash 21 Hash string `json:"hash" cborgen:"hash"` 22 // message: Commit message ··· 28 // RepoTree_Output is the output of a sh.tangled.repo.tree call. 29 type RepoTree_Output struct { 30 // dotdot: Parent directory path 31 + Dotdot *string `json:"dotdot,omitempty" cborgen:"dotdot,omitempty"` 32 + Files []*RepoTree_TreeEntry `json:"files" cborgen:"files"` 33 + LastCommit *RepoTree_LastCommit `json:"lastCommit,omitempty" cborgen:"lastCommit,omitempty"` 34 // parent: The parent path in the tree 35 Parent *string `json:"parent,omitempty" cborgen:"parent,omitempty"` 36 // readme: Readme for this file tree ··· 45 Contents string `json:"contents" cborgen:"contents"` 46 // filename: Name of the readme file 47 Filename string `json:"filename" cborgen:"filename"` 48 + } 49 + 50 + // RepoTree_Signature is a "signature" in the sh.tangled.repo.tree schema. 51 + type RepoTree_Signature struct { 52 + // email: Author email 53 + Email string `json:"email" cborgen:"email"` 54 + // name: Author name 55 + Name string `json:"name" cborgen:"name"` 56 + // when: Author timestamp 57 + When string `json:"when" cborgen:"when"` 58 } 59 60 // RepoTree_TreeEntry is a "treeEntry" in the sh.tangled.repo.tree schema.
-4
lexicons/repo/blob.json
··· 115 "type": "string", 116 "description": "Commit hash" 117 }, 118 - "shortHash": { 119 - "type": "string", 120 - "description": "Short commit hash" 121 - }, 122 "message": { 123 "type": "string", 124 "description": "Commit message"
··· 115 "type": "string", 116 "description": "Commit hash" 117 }, 118 "message": { 119 "type": "string", 120 "description": "Commit message"
+53 -5
lexicons/repo/tree.json
··· 6 "type": "query", 7 "parameters": { 8 "type": "params", 9 - "required": ["repo", "ref"], 10 "properties": { 11 "repo": { 12 "type": "string", ··· 27 "encoding": "application/json", 28 "schema": { 29 "type": "object", 30 - "required": ["ref", "files"], 31 "properties": { 32 "ref": { 33 "type": "string", ··· 45 "type": "ref", 46 "ref": "#readme", 47 "description": "Readme for this file tree" 48 }, 49 "files": { 50 "type": "array", ··· 77 }, 78 "readme": { 79 "type": "object", 80 - "required": ["filename", "contents"], 81 "properties": { 82 "filename": { 83 "type": "string", ··· 91 }, 92 "treeEntry": { 93 "type": "object", 94 - "required": ["name", "mode", "size"], 95 "properties": { 96 "name": { 97 "type": "string", ··· 113 }, 114 "lastCommit": { 115 "type": "object", 116 - "required": ["hash", "message", "when"], 117 "properties": { 118 "hash": { 119 "type": "string", ··· 123 "type": "string", 124 "description": "Commit message" 125 }, 126 "when": { 127 "type": "string", 128 "format": "datetime", 129 "description": "Commit timestamp" 130 } 131 } 132 }
··· 6 "type": "query", 7 "parameters": { 8 "type": "params", 9 + "required": [ 10 + "repo", 11 + "ref" 12 + ], 13 "properties": { 14 "repo": { 15 "type": "string", ··· 30 "encoding": "application/json", 31 "schema": { 32 "type": "object", 33 + "required": [ 34 + "ref", 35 + "files" 36 + ], 37 "properties": { 38 "ref": { 39 "type": "string", ··· 51 "type": "ref", 52 "ref": "#readme", 53 "description": "Readme for this file tree" 54 + }, 55 + "lastCommit": { 56 + "type": "ref", 57 + "ref": "#lastCommit" 58 }, 59 "files": { 60 "type": "array", ··· 87 }, 88 "readme": { 89 "type": "object", 90 + "required": [ 91 + "filename", 92 + "contents" 93 + ], 94 "properties": { 95 "filename": { 96 "type": "string", ··· 104 }, 105 "treeEntry": { 106 "type": "object", 107 + "required": [ 108 + "name", 109 + "mode", 110 + "size" 111 + ], 112 "properties": { 113 "name": { 114 "type": "string", ··· 130 }, 131 "lastCommit": { 132 "type": "object", 133 + "required": [ 134 + "hash", 135 + "message", 136 + "when" 137 + ], 138 "properties": { 139 "hash": { 140 "type": "string", ··· 144 "type": "string", 145 "description": "Commit message" 146 }, 147 + "author": { 148 + "type": "ref", 149 + "ref": "#signature" 150 + }, 151 "when": { 152 "type": "string", 153 "format": "datetime", 154 "description": "Commit timestamp" 155 + } 156 + } 157 + }, 158 + "signature": { 159 + "type": "object", 160 + "required": [ 161 + "name", 162 + "email", 163 + "when" 164 + ], 165 + "properties": { 166 + "name": { 167 + "type": "string", 168 + "description": "Author name" 169 + }, 170 + "email": { 171 + "type": "string", 172 + "description": "Author email" 173 + }, 174 + "when": { 175 + "type": "string", 176 + "format": "datetime", 177 + "description": "Author timestamp" 178 } 179 } 180 }