rtk icon indicating copy to clipboard operation
rtk copied to clipboard

git commit rejects multiple -m flags

Open axelbellec opened this issue 9 months ago • 0 comments

Problem

rtk git commit rejects multiple -m flags, which is valid native git syntax for multi-paragraph commit messages:

git commit -m "title" -m "body paragraph"

RTK error:

error: the argument '--message <MESSAGE>' cannot be used multiple times

Usage: rtk git commit [OPTIONS] --message <MESSAGE>

Root Cause

In src/main.rs:574-575, the Clap definition for Commit declares message as a single String:

Commit {
    #[arg(short, long)]
    message: String,
},

Clap treats this as a single-value argument, rejecting repeated -m flags.

Fix

Change message to Vec<String> to accept multiple -m values, then pass each one individually to git commit:

// main.rs
Commit {
    #[arg(short, long)]
    message: Vec<String>,
},

// git.rs - run_commit
for msg in &messages {
    cmd.args(["-m", msg]);
}

This matches native git behavior where multiple -m values are concatenated as separate paragraphs.

Reproduction

rtk git commit -m "title" -m "body"
# error: the argument '--message <MESSAGE>' cannot be used multiple times

axelbellec avatar Feb 18 '26 16:02 axelbellec