Skip to content

Commit a9b8ffb

Browse files
committed
fix
1 parent 4f04ab2 commit a9b8ffb

File tree

7 files changed

+15
-26
lines changed

7 files changed

+15
-26
lines changed

cmd/actions.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ import (
1515
var (
1616
// CmdActions represents the available actions sub-commands.
1717
CmdActions = &cli.Command{
18-
Name: "actions",
19-
Usage: "",
20-
Description: "Commands for managing Gitea Actions",
18+
Name: "actions",
19+
Usage: "Manage Gitea Actions",
2120
Subcommands: []*cli.Command{
2221
subcmdActionsGenRunnerToken,
2322
},

cmd/doctor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
// CmdDoctor represents the available doctor sub-command.
2727
var CmdDoctor = &cli.Command{
2828
Name: "doctor",
29-
Usage: "Diagnose and optionally fix problems",
29+
Usage: "Diagnose and optionally fix problems, convert or re-create database tables",
3030
Description: "A command to diagnose problems with the current Gitea instance according to the given configuration. Some problems can optionally be fixed by modifying the database or data storage.",
3131

3232
Subcommands: []*cli.Command{

cmd/main.go

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import (
1010

1111
"code.gitea.io/gitea/modules/log"
1212
"code.gitea.io/gitea/modules/setting"
13-
"code.gitea.io/gitea/modules/util"
1413

1514
"github.com/urfave/cli/v2"
1615
)
1716

1817
// cmdHelp is our own help subcommand with more information
18+
// Keep in mind that the "./gitea help"(subcommand) is different from "./gitea --help"(flag), the flag doesn't parse the config or output "DEFAULT CONFIGURATION:" information
1919
func cmdHelp() *cli.Command {
2020
c := &cli.Command{
2121
Name: "help",
@@ -47,16 +47,10 @@ DEFAULT CONFIGURATION:
4747
return c
4848
}
4949

50-
var helpFlag = cli.HelpFlag
51-
52-
func init() {
53-
// cli.HelpFlag = nil TODO: after https://github.com/urfave/cli/issues/1794 we can use this
54-
}
55-
5650
func appGlobalFlags() []cli.Flag {
5751
return []cli.Flag{
5852
// make the builtin flags at the top
59-
helpFlag,
53+
cli.HelpFlag,
6054

6155
// shared configuration flags, they are for global and for each sub-command at the same time
6256
// eg: such command is valid: "./gitea --config /tmp/app.ini web --config /tmp/app.ini", while it's discouraged indeed
@@ -121,8 +115,9 @@ func prepareWorkPathAndCustomConf(action cli.ActionFunc) func(ctx *cli.Context)
121115
func NewMainApp(version, versionExtra string) *cli.App {
122116
app := cli.NewApp()
123117
app.Name = "Gitea"
118+
app.HelpName = "gitea"
124119
app.Usage = "A painless self-hosted Git service"
125-
app.Description = `By default, Gitea will start serving using the web-server with no argument, which can alternatively be run by running the subcommand "web".`
120+
app.Description = `Gitea program contains "web" and other subcommands. If no subcommand is given, it starts the web server by default. Use "web" subcommand for more web server arguments, use other subcommands for other features.`
126121
app.Version = version + versionExtra
127122
app.EnableBashCompletion = true
128123

@@ -145,10 +140,6 @@ func NewMainApp(version, versionExtra string) *cli.App {
145140
cmdHelp(), // the "help" sub-command was used to show the more information for "work path" and "custom config"
146141
}
147142

148-
cmdConvert := util.ToPointer(*cmdDoctorConvert)
149-
cmdConvert.Hidden = true // still support the legacy "./gitea doctor" by the hidden sub-command, remove it in next release
150-
subCmdWithConfig = append(subCmdWithConfig, cmdConvert)
151-
152143
// these sub-commands do not need the config file, and they do not depend on any path or environment variable.
153144
subCmdStandalone := []*cli.Command{
154145
CmdCert,

docs/content/help/faq.en-us.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ If you are receiving errors on upgrade of Gitea using MySQL that read:
362362

363363
> `ORM engine initialization failed: migrate: do migrate: Error: 1118: Row size too large...`
364364
365-
Please run `gitea convert` or run `ALTER TABLE table_name ROW_FORMAT=dynamic;` for each table in the database.
365+
Please run `gitea doctor convert` or run `ALTER TABLE table_name ROW_FORMAT=dynamic;` for each table in the database.
366366

367367
The underlying problem is that the space allocated for indices by the default row format
368368
is too small. Gitea requires that the `ROWFORMAT` for its tables is `DYNAMIC`.
@@ -385,7 +385,7 @@ Unfortunately MySQL's `utf8` charset does not completely allow all possible UTF-
385385
They created a new charset and collation called `utf8mb4` that allows for emoji to be stored but tables which use
386386
the `utf8` charset, and connections which use the `utf8` charset will not use this.
387387

388-
Please run `gitea convert`, or run `ALTER DATABASE database_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;`
388+
Please run `gitea doctor convert`, or run `ALTER DATABASE database_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;`
389389
for the database_name and run `ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;`
390390
for each table in the database.
391391

docs/content/help/faq.zh-cn.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ Gitea 提供了一个子命令`gitea migrate`来初始化数据库,然后您
366366

367367
> `ORM engine initialization failed: migrate: do migrate: Error: 1118: Row size too large...`
368368
369-
请运行`gitea convert`或对数据库中的每个表运行`ALTER TABLE table_name ROW_FORMAT=dynamic;`
369+
请运行 `gitea doctor convert` 或对数据库中的每个表运行 `ALTER TABLE table_name ROW_FORMAT=dynamic;`
370370

371371
潜在问题是默认行格式分配给每个表的索引空间
372372
太小。Gitea 要求其表的`ROWFORMAT``DYNAMIC`
@@ -389,9 +389,8 @@ SET GLOBAL innodb_large_prefix=1;
389389
他们创建了一个名为 `utf8mb4`的字符集和校对规则,允许存储 Emoji,但使用
390390
utf8 字符集的表和连接将不会使用它。
391391

392-
请运行 `gitea convert` 或对数据库运行`ALTER DATABASE database_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;`
393-
并对每个表运行
394-
`ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;`
392+
请运行 `gitea doctor convert` 或对数据库运行 `ALTER DATABASE database_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;`
393+
并对每个表运行 `ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;`
395394

396395
您还需要将`app.ini`文件中的数据库字符集设置为`CHARSET=utf8mb4`
397396

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ require (
9999
github.com/syndtr/goleveldb v1.0.0
100100
github.com/tstranex/u2f v1.0.0
101101
github.com/ulikunitz/xz v0.5.11
102-
github.com/urfave/cli/v2 v2.25.7
102+
github.com/urfave/cli/v2 v2.26.0
103103
github.com/xanzy/go-gitlab v0.93.1
104104
github.com/xeipuuv/gojsonschema v1.2.0
105105
github.com/yohcop/openid-go v1.0.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,8 +1023,8 @@ github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0o
10231023
github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e/go.mod h1:tOOxU81rwgoCLoOVVPHb6T/wt8HZygqH5id+GNnlCXM=
10241024
github.com/unknwon/com v1.0.1 h1:3d1LTxD+Lnf3soQiD4Cp/0BRB+Rsa/+RTvz8GMMzIXs=
10251025
github.com/unknwon/com v1.0.1/go.mod h1:tOOxU81rwgoCLoOVVPHb6T/wt8HZygqH5id+GNnlCXM=
1026-
github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs=
1027-
github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
1026+
github.com/urfave/cli/v2 v2.26.0 h1:3f3AMg3HpThFNT4I++TKOejZO8yU55t3JnnSr4S4QEI=
1027+
github.com/urfave/cli/v2 v2.26.0/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
10281028
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
10291029
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
10301030
github.com/valyala/fasthttp v1.37.1-0.20220607072126-8a320890c08d/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I=

0 commit comments

Comments
 (0)