Skip to content

Commit 1597d53

Browse files
committed
make commit-graph write configurable
1 parent d782cad commit 1597d53

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

custom/conf/app.example.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,8 @@ LEVEL = Info
719719
;; To enable this for Git over SSH when using a OpenSSH server, add `AcceptEnv GIT_PROTOCOL` to your sshd_config file.
720720
;ENABLE_AUTO_GIT_WIRE_PROTOCOL = true
721721
;;
722+
;; Whether to write a commit graph on fetch and gc, only relevant if git version >= 2.18
723+
;;ENABLE_COMMIT_GRAPH_WRITE = true
722724
;; Respond to pushes to a non-default branch with a URL for creating a Pull Request (if the repository has them enabled)
723725
;PULL_REQUEST_PUSH_MESSAGE = true
724726
;;

modules/git/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func syncGitConfig() (err error) {
5050
}
5151
}
5252

53-
if DefaultFeatures().CheckVersionAtLeast("2.18") {
53+
if (DefaultFeatures().CheckVersionAtLeast("2.18")) && (setting.Git.EnableCommitGraphWrite) {
5454
if err := configSet("core.commitGraph", "true"); err != nil {
5555
return err
5656
}

modules/setting/git.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ var Git = struct {
2626
VerbosePushDelay time.Duration
2727
GCArgs []string `ini:"GC_ARGS" delim:" "`
2828
EnableAutoGitWireProtocol bool
29+
EnableCommitGraphWrite bool
2930
PullRequestPushMessage bool
3031
LargeObjectThreshold int64
3132
DisableCoreProtectNTFS bool
@@ -49,6 +50,7 @@ var Git = struct {
4950
VerbosePushDelay: 5 * time.Second,
5051
GCArgs: []string{},
5152
EnableAutoGitWireProtocol: true,
53+
EnableCommitGraphWrite: true,
5254
PullRequestPushMessage: true,
5355
LargeObjectThreshold: 1024 * 1024,
5456
DisablePartialClone: false,

0 commit comments

Comments
 (0)