Skip to content

Commit ba358ec

Browse files
kjellkvingelafriks
authored andcommitted
Make max commits in graph configurable (#4498)
1 parent ae9dd23 commit ba358ec

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

custom/conf/app.ini.sample

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ EXPLORE_PAGING_NUM = 20
6767
ISSUE_PAGING_NUM = 10
6868
; Number of maximum commits displayed in one activity feed
6969
FEED_MAX_COMMIT_NUM = 5
70+
; Number of maximum commits displayed in commit graph.
71+
GRAPH_MAX_COMMIT_NUM = 100
7072
; Value of `theme-color` meta tag, used by Android >= 5.0
7173
; An invalid color like "none" or "disable" will have the default style
7274
; More info: https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android

docs/content/doc/advanced/config-cheat-sheet.en-us.md

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
6868
- `EXPLORE_PAGING_NUM`: **20**: Number of repositories that are shown in one explore page.
6969
- `ISSUE_PAGING_NUM`: **10**: Number of issues that are shown in one page (for all pages that list issues).
7070
- `FEED_MAX_COMMIT_NUM`: **5**: Number of maximum commits shown in one activity feed.
71+
- `GRAPH_MAX_COMMIT_NUM`: **100**: Number of maximum commits shown in the commit graph.
7172
- `DEFAULT_THEME`: **gitea**: \[gitea, arc-green\]: Set the default theme for the Gitea install.
7273

7374
### UI - Admin (`ui.admin`)

models/graph.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"strings"
1010

1111
"code.gitea.io/git"
12+
"code.gitea.io/gitea/modules/setting"
1213
)
1314

1415
// GraphItem represent one commit, or one relation in timeline
@@ -41,7 +42,7 @@ func GetCommitGraph(r *git.Repository) (GraphItems, error) {
4142
"--all",
4243
"-C",
4344
"-M",
44-
"-n 100",
45+
fmt.Sprintf("-n %d", setting.UI.GraphMaxCommitNum),
4546
"--date=iso",
4647
fmt.Sprintf("--pretty=format:%s", format),
4748
)

modules/setting/setting.go

+2
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ var (
276276
IssuePagingNum int
277277
RepoSearchPagingNum int
278278
FeedMaxCommitNum int
279+
GraphMaxCommitNum int
279280
ReactionMaxUserNum int
280281
ThemeColorMetaTag string
281282
MaxDisplayFileSize int64
@@ -301,6 +302,7 @@ var (
301302
IssuePagingNum: 10,
302303
RepoSearchPagingNum: 10,
303304
FeedMaxCommitNum: 5,
305+
GraphMaxCommitNum: 100,
304306
ReactionMaxUserNum: 10,
305307
ThemeColorMetaTag: `#6cc644`,
306308
MaxDisplayFileSize: 8388608,

0 commit comments

Comments
 (0)