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] Auto add the branch name to commit message #301

Open
JackWP1 opened this issue Jan 3, 2023 · 3 comments
Open

[FEAT] Auto add the branch name to commit message #301

JackWP1 opened this issue Jan 3, 2023 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@JackWP1
Copy link

JackWP1 commented Jan 3, 2023

Is your feature request related to a problem? Please describe

Nope. Just another nice-to-have on already great bit of software.

Describe the solution you'd like

If there was someway of adding part or all of the branch name to the commit message automatically. Maybe there would be some regex involved of the user to customise the end result.
e.g.
Branch name: ABC-1234-some-great-feature
Commit message input pre-filled: ABC-1234 -

Additional context

Screenshot 2023-01-03 at 5 02 26 pm

@JackWP1 JackWP1 added the question Further information is requested label Jan 3, 2023
@vivaxy
Copy link
Owner

vivaxy commented Jan 16, 2023

@JackWP1 Thanks for your suggestion.

  1. Is there any other products that implements this feature?
  2. Why is the branch name associated with the commit message?

@kiero-pl
Copy link

I see no activity and I also would like to see this kind of feature in this plugin so I will try to answer at least the second question.

In my company, we have an additional policy for conventional commits. Every commit should have a task ID from Jira, eg. : "feat: RSPT-123 add new component". And we have a policy for branch naming. As you probably guess we need to have a task ID in the branch name (or "NOID" if this is a simple ad-hoc).

If this is any help we got this regex for a commitlint

"task-id-rule": ({ subject }) => {
        const regExp = /[A-Z]+-\d+|NOID/;
        return [regExp.test(subject), "subject must contain task id (eg RSPT-123) or NOID"];
},

@MMMikeM
Copy link

MMMikeM commented Oct 19, 2023

Also need this. @vivaxy are you open to a PR for this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants