ATProto Browser

ATProto Browser

Experimental browser for the Atmosphere

Record data

{
  "uri": "at://did:plc:hwevmowznbiukdf6uk5dwrrq/sh.tangled.repo.pull/3lne4rbipwe22",
  "cid": "bafyreih4rnvy4mszmr7257aurxa52edhedkqmlntuwslcfn3ca3vrptu2q",
  "value": {
    "$type": "sh.tangled.repo.pull",
    "patch": "From 0e210b2b9997c48a951a08c878ec87397092fe9c Mon Sep 17 00:00:00 2001\nFrom: Anirudh Oppiliappan <x@icyphox.sh>\nDate: Tue, 22 Apr 2025 00:35:20 +0300\nSubject: [PATCH] knotserver: add format_patch capability\n\n---\n appview/state/pull.go | 5 +++++\n knotserver/routes.go  | 1 +\n types/capabilities.go | 1 +\n 3 files changed, 7 insertions(+)\n\ndiff --git a/appview/state/pull.go b/appview/state/pull.go\nindex fc04a99..338452a 100644\n--- a/appview/state/pull.go\n+++ b/appview/state/pull.go\n@@ -670,6 +670,11 @@ func (s *State) NewPull(w http.ResponseWriter, r *http.Request) {\n \t\t\treturn\n \t\t}\n \n+\t\tif !caps.PullRequests.FormatPatch {\n+\t\t\ts.pages.Notice(w, \"pull\", \"This knot doesn't support format-patch. Unfortunately, there is no fallback for now.\")\n+\t\t\treturn\n+\t\t}\n+\n \t\t// Handle the PR creation based on the type\n \t\tif isBranchBased {\n \t\t\tif !caps.PullRequests.BranchSubmissions {\ndiff --git a/knotserver/routes.go b/knotserver/routes.go\nindex 9b6cd47..3f390a2 100644\n--- a/knotserver/routes.go\n+++ b/knotserver/routes.go\n@@ -37,6 +37,7 @@ func (h *Handle) Capabilities(w http.ResponseWriter, r *http.Request) {\n \n \tcapabilities := map[string]any{\n \t\t\"pull_requests\": map[string]any{\n+\t\t\t\"format_patch\":       true,\n \t\t\t\"patch_submissions\":  true,\n \t\t\t\"branch_submissions\": true,\n \t\t\t\"fork_submissions\":   true,\ndiff --git a/types/capabilities.go b/types/capabilities.go\nindex 2e81670..281238e 100644\n--- a/types/capabilities.go\n+++ b/types/capabilities.go\n@@ -2,6 +2,7 @@ package types\n \n type Capabilities struct {\n \tPullRequests struct {\n+\t\tFormatPatch       bool `json:\"format_patch\"`\n \t\tPatchSubmissions  bool `json:\"patch_submissions\"`\n \t\tBranchSubmissions bool `json:\"branch_submissions\"`\n \t\tForkSubmissions   bool `json:\"fork_submissions\"`\n-- \n2.48.1\n\n",
    "title": "knotserver: add format_patch capability",
    "pullId": 60,
    "targetRepo": "at://did:plc:wshs7t2adsemcrrd4snkeqli/sh.tangled.repo/3liuighjy2h22",
    "targetBranch": "master"
  }
}