Monorepo for Tangled tangled.org
854
fork

Configure Feed

Select the types of activity you want to include in your feed.

lexicons: `git.{compareRevs,formatPatch,interdiffRevs}`

to replace `repo.compare` xrpc method

Signed-off-by: Seongmin Lee <git@boltless.me>

+338
+44
api/tangled/tempcompareRevs.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package tangled 4 + 5 + // schema: sh.tangled.git.temp.compareRevs 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/lex/util" 11 + ) 12 + 13 + const ( 14 + GitTempCompareRevsNSID = "sh.tangled.git.temp.compareRevs" 15 + ) 16 + 17 + // GitTempCompareRevs_Output is the output of a sh.tangled.git.temp.compareRevs call. 18 + type GitTempCompareRevs_Output struct { 19 + // patch: format-patch output 20 + Patch string `json:"patch" cborgen:"patch"` 21 + // rev1: commit hash of rev1 22 + Rev1 *string `json:"rev1" cborgen:"rev1"` 23 + // rev2: commit hash of rev2 24 + Rev2 *string `json:"rev2" cborgen:"rev2"` 25 + } 26 + 27 + // GitTempCompareRevs calls the XRPC method "sh.tangled.git.temp.compareRevs". 28 + // 29 + // repo: AT-URI of the repository 30 + // rev1: First revision (commit, branch, or tag) 31 + // rev2: Second revision (commit, branch, or tag) 32 + func GitTempCompareRevs(ctx context.Context, c util.LexClient, repo string, rev1 string, rev2 string) (*GitTempCompareRevs_Output, error) { 33 + var out GitTempCompareRevs_Output 34 + 35 + params := map[string]interface{}{} 36 + params["repo"] = repo 37 + params["rev1"] = rev1 38 + params["rev2"] = rev2 39 + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.git.temp.compareRevs", params, nil, &out); err != nil { 40 + return nil, err 41 + } 42 + 43 + return &out, nil 44 + }
+48
api/tangled/tempformatPatch.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package tangled 4 + 5 + // schema: sh.tangled.git.temp.formatPatch 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/lex/util" 11 + ) 12 + 13 + const ( 14 + GitTempFormatPatchNSID = "sh.tangled.git.temp.formatPatch" 15 + ) 16 + 17 + // GitTempFormatPatch_Output is the output of a sh.tangled.git.temp.formatPatch call. 18 + type GitTempFormatPatch_Output struct { 19 + // patch: format-patch output 20 + Patch string `json:"patch" cborgen:"patch"` 21 + // rev1: commit hash of rev1 22 + Rev1 *string `json:"rev1" cborgen:"rev1"` 23 + // rev2: commit hash of rev2 24 + Rev2 *string `json:"rev2" cborgen:"rev2"` 25 + } 26 + 27 + // GitTempFormatPatch calls the XRPC method "sh.tangled.git.temp.formatPatch". 28 + // 29 + // repo1: AT-URI of the first repository 30 + // repo2: AT-URI of the second repository. Inherited from repo1 when not provided 31 + // rev1: First revision (commit, branch, or tag) 32 + // rev2: Second revision (commit, branch, or tag) 33 + func GitTempFormatPatch(ctx context.Context, c util.LexClient, repo1 string, repo2 string, rev1 string, rev2 string) (*GitTempFormatPatch_Output, error) { 34 + var out GitTempFormatPatch_Output 35 + 36 + params := map[string]interface{}{} 37 + params["repo1"] = repo1 38 + if repo2 != "" { 39 + params["repo2"] = repo2 40 + } 41 + params["rev1"] = rev1 42 + params["rev2"] = rev2 43 + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.git.temp.formatPatch", params, nil, &out); err != nil { 44 + return nil, err 45 + } 46 + 47 + return &out, nil 48 + }
+41
api/tangled/tempinterdiffRevs.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package tangled 4 + 5 + // schema: sh.tangled.git.temp.interdiffRevs 6 + 7 + import ( 8 + "bytes" 9 + "context" 10 + 11 + "github.com/bluesky-social/indigo/lex/util" 12 + ) 13 + 14 + const ( 15 + GitTempInterdiffRevsNSID = "sh.tangled.git.temp.interdiffRevs" 16 + ) 17 + 18 + // GitTempInterdiffRevs calls the XRPC method "sh.tangled.git.temp.interdiffRevs". 19 + // 20 + // base: Target revision (commit, branch, or tag) 21 + // rev1: Previous revision (commit, branch, or tag) 22 + // rev2: Current revision (commit, branch, or tag) 23 + // sourceRepo: AT-URI of the source repository. Inherited from targetRepo when not provided 24 + // targetRepo: AT-URI of the target repository 25 + func GitTempInterdiffRevs(ctx context.Context, c util.LexClient, base string, rev1 string, rev2 string, sourceRepo string, targetRepo string) ([]byte, error) { 26 + buf := new(bytes.Buffer) 27 + 28 + params := map[string]interface{}{} 29 + params["base"] = base 30 + params["rev1"] = rev1 31 + params["rev2"] = rev2 32 + if sourceRepo != "" { 33 + params["sourceRepo"] = sourceRepo 34 + } 35 + params["targetRepo"] = targetRepo 36 + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.git.temp.interdiffRevs", params, nil, buf); err != nil { 37 + return nil, err 38 + } 39 + 40 + return buf.Bytes(), nil 41 + }
+70
lexicons/git/temp/compareRevs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "sh.tangled.git.temp.compareRevs", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "parameters": { 8 + "type": "params", 9 + "required": ["repo", "rev1", "rev2"], 10 + "properties": { 11 + "repo": { 12 + "type": "string", 13 + "format": "at-uri", 14 + "description": "AT-URI of the repository" 15 + }, 16 + "rev1": { 17 + "type": "string", 18 + "description": "First revision (commit, branch, or tag)" 19 + }, 20 + "rev2": { 21 + "type": "string", 22 + "description": "Second revision (commit, branch, or tag)" 23 + } 24 + } 25 + }, 26 + "output": { 27 + "encoding": "application/json", 28 + "description": "Combined diff between rev1 and rev2", 29 + "schema": { 30 + "type": "object", 31 + "required": ["rev1", "rev2", "patch"], 32 + "properties": { 33 + "rev1": { 34 + "type": "ref", 35 + "ref": "sh.tangled.git.temp.defs#hash", 36 + "description": "commit hash of rev1" 37 + }, 38 + "rev2": { 39 + "type": "ref", 40 + "ref": "sh.tangled.git.temp.defs#hash", 41 + "description": "commit hash of rev2" 42 + }, 43 + "patch": { 44 + "type": "string", 45 + "description": "format-patch output" 46 + } 47 + } 48 + } 49 + }, 50 + "errors": [ 51 + { 52 + "name": "RepoNotFound", 53 + "description": "Repository not found or access denied" 54 + }, 55 + { 56 + "name": "RevisionNotFound", 57 + "description": "One or both revisions not found" 58 + }, 59 + { 60 + "name": "InvalidRequest", 61 + "description": "Invalid request parameters" 62 + }, 63 + { 64 + "name": "CompareError", 65 + "description": "Failed to compare revisions" 66 + } 67 + ] 68 + } 69 + } 70 + }
+75
lexicons/git/temp/formatPatch.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "sh.tangled.git.temp.formatPatch", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "parameters": { 8 + "type": "params", 9 + "required": ["repo1", "rev1", "rev2"], 10 + "properties": { 11 + "repo1": { 12 + "type": "string", 13 + "format": "at-uri", 14 + "description": "AT-URI of the first repository" 15 + }, 16 + "rev1": { 17 + "type": "string", 18 + "description": "First revision (commit, branch, or tag)" 19 + }, 20 + "repo2": { 21 + "type": "string", 22 + "format": "at-uri", 23 + "description": "AT-URI of the second repository. Inherited from repo1 when not provided" 24 + }, 25 + "rev2": { 26 + "type": "string", 27 + "description": "Second revision (commit, branch, or tag)" 28 + } 29 + } 30 + }, 31 + "output": { 32 + "encoding": "application/json", 33 + "description": "Format-Patch output", 34 + "schema": { 35 + "type": "object", 36 + "required": ["rev1", "rev2", "patch"], 37 + "properties": { 38 + "rev1": { 39 + "type": "ref", 40 + "ref": "sh.tangled.git.temp.defs#hash", 41 + "description": "commit hash of rev1" 42 + }, 43 + "rev2": { 44 + "type": "ref", 45 + "ref": "sh.tangled.git.temp.defs#hash", 46 + "description": "commit hash of rev2" 47 + }, 48 + "patch": { 49 + "type": "string", 50 + "description": "format-patch output" 51 + } 52 + } 53 + } 54 + }, 55 + "errors": [ 56 + { 57 + "name": "RepoNotFound", 58 + "description": "Repository not found or access denied" 59 + }, 60 + { 61 + "name": "RevisionNotFound", 62 + "description": "One or both revisions not found" 63 + }, 64 + { 65 + "name": "InvalidRequest", 66 + "description": "Invalid request parameters" 67 + }, 68 + { 69 + "name": "CompareError", 70 + "description": "Failed to compare revisions" 71 + } 72 + ] 73 + } 74 + } 75 + }
+60
lexicons/git/temp/interdiffRevs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "sh.tangled.git.temp.interdiffRevs", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "parameters": { 8 + "type": "params", 9 + "required": ["targetRepo", "base", "rev1", "rev2"], 10 + "properties": { 11 + "targetRepo": { 12 + "type": "string", 13 + "format": "at-uri", 14 + "description": "AT-URI of the target repository" 15 + }, 16 + "base": { 17 + "type": "string", 18 + "description": "Target revision (commit, branch, or tag)" 19 + }, 20 + "sourceRepo": { 21 + "type": "string", 22 + "format": "at-uri", 23 + "description": "AT-URI of the source repository. Inherited from targetRepo when not provided" 24 + }, 25 + "rev1": { 26 + "type": "string", 27 + "description": "Previous revision (commit, branch, or tag)" 28 + }, 29 + "rev2": { 30 + "type": "string", 31 + "description": "Current revision (commit, branch, or tag)" 32 + } 33 + } 34 + }, 35 + "output": { 36 + "encoding": "*/*", 37 + "description": "Interdiff output in application/json" 38 + }, 39 + "errors": [ 40 + { 41 + "name": "RepoNotFound", 42 + "description": "Repository not found or access denied" 43 + }, 44 + { 45 + "name": "RevisionNotFound", 46 + "description": "One or both revisions not found" 47 + }, 48 + { 49 + "name": "InvalidRequest", 50 + "description": "Invalid request parameters" 51 + }, 52 + { 53 + "name": "InterDiffError", 54 + "description": "Failed to interdiff revisions" 55 + } 56 + ] 57 + } 58 + } 59 + } 60 +