Skip to content

Commit f076123

Browse files
committed
Merge branch 'master' into imap
* master: Add pager to the branches page (#14202) Removed invalid form tag (#14391) Update back-up restore example for 1.13 changes (#14374) It seems vet on windows is unnecessary (#14302)
2 parents f30caf9 + 0c0445c commit f076123

File tree

11 files changed

+211
-110
lines changed

11 files changed

+211
-110
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ fmt:
232232
vet:
233233
@echo "Running go vet..."
234234
@$(GO) vet $(GO_PACKAGES)
235-
@$(GO) build -mod=vendor code.gitea.io/gitea-vet
235+
@GOOS= GOARCH= $(GO) build -mod=vendor code.gitea.io/gitea-vet
236236
@$(GO) vet -vettool=gitea-vet $(GO_PACKAGES)
237237

238238
.PHONY: $(TAGS_EVIDENCE)

custom/conf/app.example.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,10 @@ MAX_GIT_DIFF_LINES = 1000
11241124
MAX_GIT_DIFF_LINE_CHARACTERS = 5000
11251125
; Max number of files shown in diff view
11261126
MAX_GIT_DIFF_FILES = 100
1127+
; Set the default commits range size
1128+
COMMITS_RANGE_SIZE = 50
1129+
; Set the default branches range size
1130+
BRANCHES_RANGE_SIZE = 20
11271131
; Arguments for command 'git gc', e.g. "--aggressive --auto"
11281132
; see more on http://git-scm.com/docs/git-gc/
11291133
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
@@ -752,6 +752,8 @@ NB: You must `REDIRECT_MACARON_LOG` and have `DISABLE_ROUTER_LOG` set to `false`
752752
- `MAX_GIT_DIFF_LINES`: **100**: Max number of lines allowed of a single file in diff view.
753753
- `MAX_GIT_DIFF_LINE_CHARACTERS`: **5000**: Max character count per line highlighted in diff view.
754754
- `MAX_GIT_DIFF_FILES`: **100**: Max number of files shown in diff view.
755+
- `COMMITS_RANGE_SIZE`: **50**: Set the default commits range size
756+
- `BRANCHES_RANGE_SIZE`: **20**: Set the default branches range size
755757
- `GC_ARGS`: **\<empty\>**: Arguments for command `git gc`, e.g. `--aggressive --auto`. See more on http://git-scm.com/docs/git-gc/
756758
- `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
757759
- `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)

docs/content/doc/usage/backup-and-restore.en-us.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,21 @@ involves moving files to their correct locations and restoring a database dump.
7272
Example:
7373

7474
```sh
75-
apt-get install gitea
76-
unzip gitea-dump-1482906742.zip
77-
cd gitea-dump-1482906742
78-
mv custom/conf/app.ini /etc/gitea/conf/app.ini # or mv app.ini /etc/gitea/conf/app.ini
79-
unzip gitea-repo.zip
80-
mv gitea-repo/* /var/lib/gitea/repositories/
81-
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea/repositories/
75+
unzip gitea-dump-1610949662.zip
76+
cd gitea-dump-1610949662
77+
mv data/conf/app.ini /etc/gitea/conf/app.ini
78+
mv data/* /var/lib/gitea/data/
79+
mv log/* /var/lib/gitea/log/
80+
mv repos/* /var/lib/gitea/repositories/
81+
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea
82+
83+
# mysql
8284
mysql --default-character-set=utf8mb4 -u$USER -p$PASS $DATABASE <gitea-db.sql
83-
# or sqlite3 $DATABASE_PATH <gitea-db.sql
85+
# sqlite3
86+
sqlite3 $DATABASE_PATH <gitea-db.sql
87+
# postgres
88+
psql -U $USER -d $DATABASE < gitea-db.sql
89+
8490
service gitea restart
8591
```
8692

docs/content/doc/usage/backup-and-restore.zh-cn.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,21 @@ Gitea 已经实现了 `dump` 命令可以用来备份所有需要的文件到一
4646

4747
例如:
4848

49-
```
50-
apt-get install gitea
51-
unzip gitea-dump-1482906742.zip
52-
cd gitea-dump-1482906742
53-
mv custom/conf/app.ini /etc/gitea/conf/app.ini
54-
unzip gitea-repo.zip
55-
mv gitea-repo/* /var/lib/gitea/repositories/
56-
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea/repositories/
49+
```sh
50+
unzip gitea-dump-1610949662.zip
51+
cd gitea-dump-1610949662
52+
mv data/conf/app.ini /etc/gitea/conf/app.ini
53+
mv data/* /var/lib/gitea/data/
54+
mv log/* /var/lib/gitea/log/
55+
mv repos/* /var/lib/gitea/repositories/
56+
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea
57+
58+
# mysql
5759
mysql --default-character-set=utf8mb4 -u$USER -p$PASS $DATABASE <gitea-db.sql
58-
# or sqlite3 $DATABASE_PATH <gitea-db.sql
60+
# sqlite3
61+
sqlite3 $DATABASE_PATH <gitea-db.sql
62+
# postgres
63+
psql -U $USER -d $DATABASE < gitea-db.sql
64+
5965
service gitea restart
6066
```

docs/content/doc/usage/backup-and-restore.zh-tw.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,23 @@ Gitea 目前支援 `dump` 指令,用來將資料備份成 zip 檔案,後續
4343
## 還原指令 (`restore`)
4444

4545
持續更新中: 此文件尚未完成.
46+
47+
例:
48+
```sh
49+
unzip gitea-dump-1610949662.zip
50+
cd gitea-dump-1610949662
51+
mv data/conf/app.ini /etc/gitea/conf/app.ini
52+
mv data/* /var/lib/gitea/data/
53+
mv log/* /var/lib/gitea/log/
54+
mv repos/* /var/lib/gitea/repositories/
55+
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea
56+
57+
# mysql
58+
mysql --default-character-set=utf8mb4 -u$USER -p$PASS $DATABASE <gitea-db.sql
59+
# sqlite3
60+
sqlite3 $DATABASE_PATH <gitea-db.sql
61+
# postgres
62+
psql -U $USER -d $DATABASE < gitea-db.sql
63+
64+
service gitea restart
65+
```

modules/git/repo_commit.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ func (repo *Repository) GetCommitByPath(relpath string) (*Commit, error) {
110110
// CommitsRangeSize the default commits range size
111111
var CommitsRangeSize = 50
112112

113+
// BranchesRangeSize the default branches range size
114+
var BranchesRangeSize = 20
115+
113116
func (repo *Repository) commitsByRange(id SHA1, page, pageSize int) (*list.List, error) {
114117
stdout, err := NewCommand("log", id.String(), "--skip="+strconv.Itoa((page-1)*pageSize),
115118
"--max-count="+strconv.Itoa(pageSize), prettyLogFormat).RunInDirBytes(repo.Path)

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)