Skip to content

feat(args): add default value for --prepend option#1549

Open
CatBraaain wants to merge 1 commit into
orhun:mainfrom
CatBraaain:add-prepend-default
Open

feat(args): add default value for --prepend option#1549
CatBraaain wants to merge 1 commit into
orhun:mainfrom
CatBraaain:add-prepend-default

Conversation

@CatBraaain

Copy link
Copy Markdown

Description

git cliff # prepend to stdout
git cliff -p # prepend to CHANGELOG.md
git cliff -p OTHER_FILE.md # prepend to another file

If -p is given and path is omitted, prepend to CHANGELOG.md, like what --output option is.

related PR: #354

Motivation and Context

Align the behavior of --prepend with the existing --output option.
Since CHANGELOG.md is the target file in most cases, this makes the command more convenient to use.

How Has This Been Tested?

# cli test
cargo +stable-x86_64-pc-windows-msvc build --release

target/release/git-cliff -u              # printed unreleased
target/release/git-cliff -u -p           # added unreleased to CHANGELOG.md
target/release/git-cliff -u -p README.md # added unreleased to README.md

# website test
cd website
vp install
vp run build
vp run serve # The website builds successfully and the updated documentation is displayed correctly.

Screenshots / Logs (if applicable)

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • 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 (if applicable).
  • I have formatted the code with rustfmt.
    • cargo +nightly fmt --all
  • I checked the lints with clippy.
    • cargo clippy --tests --verbose -- -D warnings
  • I have added tests to cover my changes.
  • All new and existing tests passed.
    • cargo test

@CatBraaain CatBraaain requested a review from orhun as a code owner June 2, 2026 08:16
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.61%. Comparing base (772e01d) to head (f4b9f8a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1549      +/-   ##
==========================================
- Coverage   48.65%   48.61%   -0.04%     
==========================================
  Files          26       26              
  Lines        2288     2288              
==========================================
- Hits         1113     1112       -1     
- Misses       1175     1176       +1     
Flag Coverage Δ
unit-tests 48.61% <ø> (-0.04%) ⬇️

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.

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.

2 participants