-
Notifications
You must be signed in to change notification settings - Fork 320
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
Feature: Support git commit prefixes #59
Comments
hi hi would be cool to have this configurable via |
I just came to ask the same question, it would be great a feature like this, for now without this configuration I can't use oc. # Commit everything
function commit() {
commitMessage="$1"
if [ "$commitMessage" = "" ]; then
commitMessage="wip"
fi
# check if getIssueName returns a value and if it does, then prepend it to the commit message
if [ -n "$(getIssueName)" ]; then
commitMessage="$(getIssueName): $commitMessage"
fi
git add .
git status
eval "git commit -a -m \"${commitMessage}\" $2"
} I have another function Taking the example of @adrianrivers commit "Changes in the user module" The final message would be: Now, if there was a way to extract the output suggested by opencommit, a function like this could be done automatically. # Commit everything
function commit() {
commitMessage="$1"
if [ "$commitMessage" = "" ]; then
commitMessage="wip"
fi
generatedMessage="oc --raw" #or sometinhg like that
# check if getIssueName returns a value and if it does, then prepend it to the commit message
if [ -n "$(getIssueName)" ]; then
commitMessage="$(getIssueName): $generatedMessage"
fi
git add .
git status
eval "git commit -a -m \"${commitMessage}\" $2"
} |
I would like to have config options like below:
|
I believe anybody wants to make a PR? |
It would be great, but I think it would be very difficult to create a regex to identify the ticket of each one, since it could be anything, don't you think? |
Stale issue message |
Hi, I'm happy to contribute to this. My work requires that the ticket be referenced in all commit messages e.g.
foo-1243-feature-button-component
. I'm wondering if it is viable to make the commits reference the ticket number from the branch name e.g.feat/foo-1234-button
would result in commit messages being prefixed withfoo-1234: blah blah
?The text was updated successfully, but these errors were encountered: