add a fake -a flag for muscle memory#13667
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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/--allflag tobut commitargs and plumb it into the legacy commit implementation. - Print a human-mode hint when
-a/--allis 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...")?; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.