-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
migrate urfave/cli to v2 version #10912
Conversation
CI failed seems related. |
Yes .. still same problem (Internal binary exec call behave diffenent) |
IIRC, this PR is blocked by the different behavior for argument orders between urfave/cli v1 and v2 ? https://github.com/urfave/cli/blob/main/docs/migrate-v1-to-v2.md#flags-before-args It has been a long time, if it is the case, then there might be 2 choices:
Correct me if I am wrong ..... |
It depends on how much benefit for Gitea migrate to v2. |
The design of urfave/cli.v2 is overall better than v1, except the |
How about my suggestion in #10912 (comment) |
POSIX-compliance is the quoted reason, and my guess is it makes parsing much less complex. I am personally not a fan of |
I'm for change how internal git command create arguments - this will be breaking but should be fine if git hooks are recreated |
We can write a migration task to delete the Gitea binary path in AppState table, then Gitea will re-create all hooks automatically. However, there are many scripts using Gitea binary, such change would break |
I presume that this args change doesn't mean that even subcommand args have to be before the subcommand? If so looking at our docs we say:
So whilst it's a breaking change it's more an undocumented change. |
-> Refactor to use urfave/cli/v2 #25959 |
Replace #10912 And there are many new tests to cover the CLI behavior There were some concerns about the "option order in hook scripts" (#10912 (comment)), it's not a problem now. Because the hook script uses `/gitea hook --config=/app.ini pre-receive` format. The "config" is a global option, it can appear anywhere. ---- ##⚠️ BREAKING⚠️ This PR does it best to avoid breaking anything. The major changes are: * `gitea` itself won't accept web's options: `--install-port` / `--pid` / `--port` / `--quiet` / `--verbose` .... They are `web` sub-command's options. * Use `./gitea web --pid ....` instead * `./gitea` can still run the `web` sub-command as shorthand, with default options * The sub-command's options must follow the sub-command * Before: `./gitea --sub-opt subcmd` might equal to `./gitea subcmd --sub-opt` (well, might not ...) * After: only `./gitea subcmd --sub-opt` could be used * The global options like `--config` are not affected
as title
references: