Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: check all autosquash messages #395

Merged
merged 1 commit into from
Dec 19, 2024
Merged

Conversation

JP-Ellis
Copy link
Contributor

@JP-Ellis JP-Ellis commented Sep 19, 2024

Expand the autosquash prefixes from just fixup! to now include squash! and amend!. These are the prefixes supported by default when using Git's --autosquash.

To keep the commits atomic as requested in #394, this commit only changes the functionality, while leaving the configuration as is (thereby creating an mismatch between the config naming, and resulting behaviour)

EDIT: New commit message will be:

Committed, until now, only supported the fixup! prefix. The standard Git implementation of --autosquash also supports squash! and amend!. This commit modifies the logic of the handling of fixup! to support the other two prefixes in the same way.

Note that this purely changes the logic. Function names and options remain unchanged to ensure backwards compatibility. It may be worth considering renaming this to autosquash given it is motivated primarily by Git's --autosquash flag.

Ref: https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---autosquash

crates/committed/src/checks.rs Fixed Show fixed Hide fixed
crates/committed/src/checks.rs Fixed Show fixed Hide fixed
@epage
Copy link
Collaborator

epage commented Sep 19, 2024

feat!

For myself, I don't think I'd consider this a major breaking change. Its a minor breaking change that expands functionality to cover cases that either didn't exist or were unknown at the time of creation.

@epage epage mentioned this pull request Sep 19, 2024
@JP-Ellis
Copy link
Contributor Author

I would have considered this to be a breaking change, but if you don't, you should then use a squash-and-rebase instead of a merge. This way, you can ensure the commit message is exactly as you want.

@epage
Copy link
Collaborator

epage commented Sep 19, 2024

This is blocked on CI. Since you have to edit this anyways, please remove !.

auto-merge was automatically disabled September 19, 2024 22:19

Head branch was pushed to by a user without write access

@JP-Ellis
Copy link
Contributor Author

As requested I have removed the breaking change exclamation from the commit message. I do not know if CI is fixed yet though.

@epage
Copy link
Collaborator

epage commented Sep 20, 2024

Looks like cargo fmt also needs to be run.

@coveralls
Copy link

coveralls commented Sep 20, 2024

Pull Request Test Coverage Report for Build 12404415424

Details

  • 0 of 6 (0.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 4.928%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/committed/src/checks.rs 0 6 0.0%
Files with Coverage Reduction New Missed Lines %
crates/committed/src/checks.rs 2 1.76%
Totals Coverage Status
Change from base Build 12396787315: -0.02%
Covered Lines: 24
Relevant Lines: 487

💛 - Coveralls

@epage epage changed the title feat!: check all autosquash messages feat: check all autosquash messages Sep 20, 2024
Committed, until now, only supported the `fixup!` prefix. The standard
Git implementation of `--autosquash` also supports `squash!` and
`amend!`. This commit modifies the logic of the handling of `fixup!` to
support the other two prefixes in the same way.

Note that this purely changes the logic. Function names and options
remain unchanged to ensure backwards compatibility. It may be worth
considering renaming this to `autosquash` given it is motivated
primarily by Git's `--autosquash` flag.

Ref: https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---autosquash
Signed-off-by: JP-Ellis <[email protected]>
@JP-Ellis
Copy link
Contributor Author

Rebased the PR on top of master so it can merge.

@epage epage merged commit 79254d6 into crate-ci:master Dec 19, 2024
17 checks passed
@JP-Ellis JP-Ellis deleted the feat/autosquash branch December 19, 2024 02:09
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.

3 participants