Skip to content

Commit

Permalink
Merge branch 'main' into fix-17514-add-warning-bidi-characters
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 committed Jan 6, 2022
2 parents aac0e1d + 36a0f4e commit f66923f
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 47 deletions.
6 changes: 4 additions & 2 deletions custom/conf/app.example.ini
Expand Up @@ -592,6 +592,8 @@ PATH =
;LARGE_OBJECT_THRESHOLD = 1048576
;; Set to true to forcibly set core.protectNTFS=false
;DISABLE_CORE_PROTECT_NTFS=false
;; Disable the usage of using partial clones for git.
;DISABLE_PARTIAL_CLONE = false

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down Expand Up @@ -786,11 +788,11 @@ PATH =
;PULL_REQUEST_QUEUE_LENGTH = 1000
;;
;; Preferred Licenses to place at the top of the List
;; The name here must match the filename in conf/license or custom/conf/license
;; The name here must match the filename in options/license or custom/options/license
;PREFERRED_LICENSES = Apache License 2.0,MIT License
;;
;; Disable the ability to interact with repositories using the HTTP protocol
;;DISABLE_HTTP_GIT = false
;DISABLE_HTTP_GIT = false
;;
;; Value for Access-Control-Allow-Origin header, default is not to present
;; WARNING: This may be harmful to your website if you do not give it a right value.
Expand Down
31 changes: 2 additions & 29 deletions docs/content/doc/advanced/clone-filter.en-us.md
Expand Up @@ -27,36 +27,9 @@ on the client is at least the same as on the server (or later). Login to
Gitea server as admin and head to Site Administration -> Configuration to
see Git version of the server.

By default, clone filters are disabled, which cause the server to ignore
`--filter` option.
By default, clone filters are enabled, unless `DISABLE_PARTIAL_CLONE` under
`[git]` is set to `true`.

To enable clone filters on per-repo basis, edit the repo's `config` on
repository location. Consult `ROOT` option on `repository` section of
Gitea configuration (`app.ini`) for the exact location. For example, to
enable clone filters for `some-repo`, edit
`/var/gitea/data/gitea-repositories/some-user/some-repo.git/config` and add:

```ini
[uploadpack]
allowfilter = true
```

To enable clone filters globally, add that config above to `~/.gitconfig`
of user that run Gitea (for example `git`).

Alternatively, you can use `git config` to set the option.

To enable for a specific repo:

```bash
cd /var/gitea/data/gitea-repositories/some-user/some-repo.git
git config --local uploadpack.allowfilter true
```
To enable globally, login as user that run Gitea and:

```bash
git config --global uploadpack.allowfilter true
```

See [GitHub blog post: Get up to speed with partial clone](https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/)
for common use cases of clone filters (blobless and treeless clones), and
Expand Down
2 changes: 2 additions & 0 deletions docs/content/doc/advanced/config-cheat-sheet.en-us.md
Expand Up @@ -933,6 +933,8 @@ NB: You must have `DISABLE_ROUTER_LOG` set to `false` for this option to take ef
- `VERBOSE_PUSH_DELAY`: **5s**: Only print verbose information if push takes longer than this delay.
- `LARGE_OBJECT_THRESHOLD`: **1048576**: (Go-Git only), don't cache objects greater than this in memory. (Set to 0 to disable.)
- `DISABLE_CORE_PROTECT_NTFS`: **false** Set to true to forcibly set `core.protectNTFS` to false.
- `DISABLE_PARTIAL_CLONE`: **false** Disable the usage of using partial clones for git.

## Git - Timeout settings (`git.timeout`)
- `DEFAUlT`: **360**: Git operations default timeout seconds.
- `MIGRATE`: **600**: Migrate external repositories timeout seconds.
Expand Down
5 changes: 5 additions & 0 deletions modules/git/git.go
Expand Up @@ -146,6 +146,11 @@ func Init(ctx context.Context) error {
GlobalCommandArgs = append(GlobalCommandArgs, "-c", "protocol.version=2")
}

// By default partial clones are disabled, enable them from git v2.22
if !setting.Git.DisablePartialClone && CheckGitVersionAtLeast("2.22") == nil {
GlobalCommandArgs = append(GlobalCommandArgs, "-c", "uploadpack.allowfilter=true")
}

// Save current git version on init to gitVersion otherwise it would require an RWMutex
if err := LoadGitVersion(); err != nil {
return err
Expand Down
2 changes: 2 additions & 0 deletions modules/setting/git.go
Expand Up @@ -27,6 +27,7 @@ var (
PullRequestPushMessage bool
LargeObjectThreshold int64
DisableCoreProtectNTFS bool
DisablePartialClone bool
Timeout struct {
Default int
Migrate int
Expand All @@ -48,6 +49,7 @@ var (
EnableAutoGitWireProtocol: true,
PullRequestPushMessage: true,
LargeObjectThreshold: 1024 * 1024,
DisablePartialClone: false,
Timeout: struct {
Default int
Migrate int
Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -22,7 +22,7 @@
"less": "4.1.2",
"less-loader": "10.2.0",
"license-checker-webpack-plugin": "0.2.1",
"mermaid": "8.13.4",
"mermaid": "8.13.8",
"mini-css-extract-plugin": "2.4.5",
"monaco-editor": "0.30.1",
"monaco-editor-webpack-plugin": "6.0.0",
Expand Down

0 comments on commit f66923f

Please sign in to comment.