aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorMatthew Walowski <mattwalowski@gmail.com>2023-05-08 18:06:05 -0700
committerGitHub <noreply@github.com>2023-05-09 09:06:05 +0800
commit1dd83dbb917d55bd253001646d6743f247a4d98b (patch)
tree8c0a0f9e6903e366a7ed8ee043f686ecd40f343a /templates
parent707c7e60c94c5b0d27ade7462dda1e526d35f369 (diff)
downloadgitea-1dd83dbb917d55bd253001646d6743f247a4d98b.tar.gz
gitea-1dd83dbb917d55bd253001646d6743f247a4d98b.zip
Filters for GetAllCommits (#24568)
The `GetAllCommits` endpoint can be pretty slow, especially in repos with a lot of commits. The issue is that it spends a lot of time calculating information that may not be useful/needed by the user. The `stat` param was previously added in #21337 to address this, by allowing the user to disable the calculating stats for each commit. But this has two issues: 1. The name `stat` is rather misleading, because disabling `stat` disables the Stat **and** Files. This should be separated out into two different params, because getting a list of affected files is much less expensive than calculating the stats 2. There's still other costly information provided that the user may not need, such as `Verification` This PR, adds two parameters to the endpoint, `files` and `verification` to allow the user to explicitly disable this information when listing commits. The default behavior is true.
Diffstat (limited to 'templates')
-rw-r--r--templates/swagger/v1_json.tmpl12
1 files changed, 12 insertions, 0 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index 7923e93ca4..99c49fec9c 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -3795,6 +3795,18 @@
"in": "query"
},
{
+ "type": "boolean",
+ "description": "include verification for every commit (disable for speedup, default 'true')",
+ "name": "verification",
+ "in": "query"
+ },
+ {
+ "type": "boolean",
+ "description": "include a list of affected files for every commit (disable for speedup, default 'true')",
+ "name": "files",
+ "in": "query"
+ },
+ {
"type": "integer",
"description": "page number of results to return (1-based)",
"name": "page",