Skip to content

add a fake -a flag for muscle memory#13667

Merged
schacon merged 1 commit into
masterfrom
sc-branch-99
May 13, 2026
Merged

add a fake -a flag for muscle memory#13667
schacon merged 1 commit into
masterfrom
sc-branch-99

Conversation

@schacon
Copy link
Copy Markdown
Member

@schacon schacon commented May 6, 2026

I constantly still run but commit -am 'something' because I'm used to Git for -a. Thought it would be nice to not have it blow up every time.

Copilot AI review requested due to automatic review settings May 6, 2026 14:34
@github-actions github-actions Bot added rust Pull requests that update Rust code CLI The command-line program `but` labels May 6, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a -a/--all compatibility flag to but commit to support Git “muscle memory”, treating it as a no-op while optionally emitting a human-facing hint. This is implemented in the legacy commit path, with accompanying tests and CLI skill/reference documentation updates.

Changes:

  • Add -a/--all flag to but commit args and plumb it into the legacy commit implementation.
  • Print a human-mode hint when -a/--all is used.
  • Add a regression test and update skill/reference docs to document the compatibility behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/but/tests/but/command/commit.rs Adds a test asserting commit -am ... succeeds and prints the hint.
crates/but/src/lib.rs Rejects --all for commit empty and passes the all flag through to legacy commit.
crates/but/src/command/legacy/commit.rs Implements the hint emission when -a/--all is provided (human output only).
crates/but/src/args/commit.rs Introduces the new -a/--all CLI flag as a documented no-op.
crates/but/skill/SKILL.md Documents but commit -a as a no-op compatibility flag.
crates/but/skill/references/reference.md Adds an example showing -am usage and clarifies -a is a no-op.

#[clap(short = 'o', long = "only")]
pub only: bool,
/// No-op compatibility flag for `git commit -a`.
#[clap(short = 'a', long = "all")]
let t = theme::get();

if all && let Some(out) = out.for_human() {
writeln!(out, "no need for -a here my friend...")?;
@schacon schacon merged commit 96bc90e into master May 13, 2026
36 checks passed
@schacon schacon deleted the sc-branch-99 branch May 13, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLI The command-line program `but` rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants