Skip to content

Commit 9ab70a4

Browse files
committed
Make branches commit range configurable
Signed-off-by: Andrew Thornton <[email protected]>
1 parent 29c5745 commit 9ab70a4

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

custom/conf/app.example.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,10 @@ MAX_GIT_DIFF_LINES = 1000
10841084
MAX_GIT_DIFF_LINE_CHARACTERS = 5000
10851085
; Max number of files shown in diff view
10861086
MAX_GIT_DIFF_FILES = 100
1087+
; Set the default commits range size
1088+
COMMITS_RANGE_SIZE = 50
1089+
; Set the default branches range size
1090+
BRANCHES_RANGE_SIZE = 20
10871091
; Arguments for command 'git gc', e.g. "--aggressive --auto"
10881092
; see more on http://git-scm.com/docs/git-gc/
10891093
GC_ARGS =

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,8 @@ NB: You must `REDIRECT_MACARON_LOG` and have `DISABLE_ROUTER_LOG` set to `false`
747747
- `MAX_GIT_DIFF_LINES`: **100**: Max number of lines allowed of a single file in diff view.
748748
- `MAX_GIT_DIFF_LINE_CHARACTERS`: **5000**: Max character count per line highlighted in diff view.
749749
- `MAX_GIT_DIFF_FILES`: **100**: Max number of files shown in diff view.
750+
- `COMMITS_RANGE_SIZE`: **50**: Set the default commits range size
751+
- `BRANCHES_RANGE_SIZE`: **20**: Set the default branches range size
750752
- `GC_ARGS`: **\<empty\>**: Arguments for command `git gc`, e.g. `--aggressive --auto`. See more on http://git-scm.com/docs/git-gc/
751753
- `ENABLE_AUTO_GIT_WIRE_PROTOCOL`: **true**: If use git wire protocol version 2 when git version >= 2.18, default is true, set to false when you always want git wire protocol version 1
752754
- `PULL_REQUEST_PUSH_MESSAGE`: **true**: Respond to pushes to a non-default branch with a URL for creating a Pull Request (if the repository has them enabled)

modules/setting/git.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ var (
1919
MaxGitDiffLines int
2020
MaxGitDiffLineCharacters int
2121
MaxGitDiffFiles int
22+
CommitsRangeSize int
23+
BranchesRangeSize int
2224
VerbosePush bool
2325
VerbosePushDelay time.Duration
2426
GCArgs []string `ini:"GC_ARGS" delim:" "`
@@ -37,6 +39,8 @@ var (
3739
MaxGitDiffLines: 1000,
3840
MaxGitDiffLineCharacters: 5000,
3941
MaxGitDiffFiles: 100,
42+
CommitsRangeSize: 50,
43+
BranchesRangeSize: 20,
4044
VerbosePush: true,
4145
VerbosePushDelay: 5 * time.Second,
4246
GCArgs: []string{},
@@ -91,5 +95,8 @@ func newGit() {
9195
args = append(args, "Version 2") // for focus color
9296
}
9397

98+
git.CommitsRangeSize = Git.CommitsRangeSize
99+
git.BranchesRangeSize = Git.BranchesRangeSize
100+
94101
log.Info(format, args...)
95102
}

0 commit comments

Comments
 (0)