Skip to content

Conversation

@ritoban23
Copy link
Contributor

Description

Added help_heading = "REMOTE OPTIONS" to all remote-related CLI arguments (--github-token, --github-repo, --gitlab-token, --gitlab-repo, --gitea-token, --gitea-repo, --bitbucket-token, --bitbucket-repo) to group them under a dedicated "REMOTE OPTIONS" section in the help output.

Motivation and Context

Fixes #1270

How Has This Been Tested?

  • Built the project successfully using cargo build
  • Ran git-cliff -h to verify the help output shows the new "REMOTE OPTIONS" section
  • Confirmed all remote arguments are properly grouped under the new heading
  • Ran cargo test to ensure CLI argument parsing tests pass (the verify_cli test validates the argument structure)

Screenshots / Logs (if applicable)

Types of Changes

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (no code change)
  • Refactor (refactoring production code)
  • Other

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.
  • I have formatted the code with rustfmt.
  • I checked the lints with clippy.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@ritoban23 ritoban23 requested a review from orhun as a code owner September 28, 2025 22:42
@welcome
Copy link

welcome bot commented Sep 28, 2025

Thanks for opening this pull request! Please check out our contributing guidelines! ⛰️

@codecov-commenter
Copy link

codecov-commenter commented Sep 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.51%. Comparing base (ee9f742) to head (d7228ad).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1271      +/-   ##
==========================================
- Coverage   43.55%   43.51%   -0.03%     
==========================================
  Files          22       22              
  Lines        1984     1972      -12     
==========================================
- Hits          864      858       -6     
+ Misses       1120     1114       -6     
Flag Coverage Δ
unit-tests 43.51% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Owner

@orhun orhun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the PR :)

The formatting looks a bit off, can you fix it?

Also we need to update https://git-cliff.org/docs/usage/args#args with the new help output as well.

Copy link
Owner

@orhun orhun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the changes!

One issue that I realized is:

OPTIONS:
  -i, --init [<CONFIG>]            Writes the default configuration file to cliff.toml
  -c, --config <PATH>              Sets the configuration file [env: GIT_CLIFF_CONFIG=] [default: cliff.toml]
      --config-url <URL>           Sets the URL for the configuration file [env: GIT_CLIFF_CONFIG_URL=]
  -w, --workdir <PATH>             Sets the working directory [env: GIT_CLIFF_WORKDIR=]
  -r, --repository <PATH>...       Sets the git repository [env: GIT_CLIFF_REPOSITORY=]
      --include-path <PATTERN>...  Sets the path to include related commits [env: GIT_CLIFF_INCLUDE_PATH=]
      --exclude-path <PATTERN>...  Sets the path to exclude related commits [env: GIT_CLIFF_EXCLUDE_PATH=]
      --tag-pattern <PATTERN>      Sets the regex for matching git tags [env: GIT_CLIFF_TAG_PATTERN=]
      --with-commit <MSG>...       Sets custom commit messages to include in the changelog [env: GIT_CLIFF_WITH_COMMIT=]
      --with-tag-message [<MSG>]   Sets custom message for the latest release [env: GIT_CLIFF_WITH_TAG_MESSAGE=]
      --ignore-tags <PATTERN>      Sets the tags to ignore in the changelog [env: GIT_CLIFF_IGNORE_TAGS=]
      --count-tags <PATTERN>       Sets the tags to count in the changelog [env: GIT_CLIFF_COUNT_TAGS=]
      --skip-commit <SHA1>...      Sets commits that will be skipped in the changelog [env: GIT_CLIFF_SKIP_COMMIT=]
  -p, --prepend <PATH>             Prepends entries to the given changelog file [env: GIT_CLIFF_PREPEND=]
  -o, --output [<PATH>]            Writes output to the given file [env: GIT_CLIFF_OUTPUT=]
  -t, --tag <TAG>                  Sets the tag for the latest version [env: GIT_CLIFF_TAG=]
      --bump [<BUMP>]              Bumps the version for unreleased changes. Optionally with specified version
  -b, --body <TEMPLATE>            Sets the template for the changelog body [env: GIT_CLIFF_TEMPLATE=]
      --from-context <PATH>        Generates changelog from a JSON context [env: GIT_CLIFF_CONTEXT=]
  -s, --strip <PART>               Strips the given parts from the changelog [possible values: header, footer, all]
      --sort <SORT>                Sets sorting of the commits inside sections [default: oldest] [possible values: oldest, newest]

ARGS:
  [RANGE]  Sets the commit range to process

REMOTE OPTIONS:
      --github-token <TOKEN>         Sets the GitHub API token [env: GITHUB_TOKEN]
      --github-repo <OWNER/REPO>     Sets the GitHub repository [env: GITHUB_REPO=]
      --gitlab-token <TOKEN>         Sets the GitLab API token [env: GITLAB_TOKEN]
      --gitlab-repo <OWNER/REPO>     Sets the GitLab repository [env: GITLAB_REPO=]
      --gitea-token <TOKEN>          Sets the Gitea API token [env: GITEA_TOKEN]
      --gitea-repo <OWNER/REPO>      Sets the Gitea repository [env: GITEA_REPO=]
      --bitbucket-token <TOKEN>      Sets the Bitbucket API token [env: BITBUCKET_TOKEN]
      --bitbucket-repo <OWNER/REPO>  Sets the Bitbucket repository [env: BITBUCKET_REPO=]

The remote options are now listed after ARGS. Ideally REMOTE OPTIONS should come after OPTIONS.

It might be something about the order of the arguments in the struct. Can you look into it?

Copy link
Owner

@orhun orhun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for your contribution!

@orhun orhun merged commit 0b6af12 into orhun:main Sep 29, 2025
89 of 91 checks passed
@welcome
Copy link

welcome bot commented Sep 29, 2025

Congrats on merging your first pull request! ⛰️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set help heading for the remote-related CLI arguments

3 participants